home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tvos200.zip
/
README.OS2
< prev
Wrap
Text File
|
1995-04-25
|
10KB
|
199 lines
Turbo Vision 2.0 for OS/2
-------------------------
Author: F. Jalvingh
CompuServe: 100450,454
Internet: jalving@ibm.net
See changes.log for a list of changes made to the sources (and why).
Currently this is a TEST version. The thing compiles with a number of TV
project I have, and runs acceptably. Please report any problems; I'll try
to solve things as they come.
This is my FIRST try to get this out into the open. Therefore it is possible
(even very likely) that stuff is missing from this file, or that you have
problems recompiling all of this. If so, please let me know and I'll try to
solve it. Also, the port is still in progress; this is merely ment to give
you an idea of how it will look....
Legal stuff
-----------
This port is in the public domain, but the Turbo Vision source is not. You
are granted the right to do what you want with the non-Turbo Vision code, but
of course you're still bound to the Turbo Vision licence.
I hold no rights to the code I wrote; do with it what you want. I will not be
responsible for any damage resulting in the use of the code, and I will not
garantuee fitness for any purpose.
What is it?
-----------
This package allows Turbo Vision programs for OS/2 to be created. It consists
of a DIFF file and some auxiliary files that patch the original Turbo Vision
2.0 sources, provided with the Borland Powerpack for DOS 1.0.
The resulting package can then be compiled with both Borland C++ or WatCOM
C++ to create an OS/2 native 32-bits version of Turbo Vision. Compiling for
IBM C Set/2 is possible, but I have not yet tested that with this version, so
it will need work.
What is it not?
---------------
This port is a rather straightforward port of the original code. This code was
created for a single-tasking DOS machine, and so no special provisions are made
for any OS/2 multithreading. Also, to keep the porting process simple (and the
port compatible) I've tried to make minimal changes to the interface. This was
quite a struggle with my conscience (because it would be much more nice to
create an OS/2 specific Turbo Vision by rewriting all "hardware level" classes)
but the result should allow quite easy porting of applications.
The port to OS/2 has the following peculiarities:
* It isn't too fast. The basic window rendering algorithm in TV is horrible,
and was written in Assembler by Borland to provide a reasonable working
speed. This assembler code is not completely ported yet so I made a C++
version of the code. Which isn't very fast... I'm still working on porting
the assembler module, so..
Even with the assembler module in use, Turbo Vision will probably be still
quite slow because of the overhead caused by a zillion VIO calls.. I would
like to rewrite the rendering code to something more reasonable but that
would mean rewriting large parts of the TGroup and TView base classes, and
I'm still checking to see whether that would break things.
* Shadows are currently not supported. The C++ writeView was slow enough as
it was, and I didn't want to slow it down even more. Besides, I already had
haemorrhoids from decoding and implementing the C++ code from the assembly
code, so there.
* TV has at it's base an event loop. When doing nothing at all, a TV process
is very, very busy checking whether any event has occured and calling the
idle() call. This causes a CPU utilization of 100% when doing nothing.
The event loop has separate calls to get mouse events and to get keyboard
events. This sucks, and prevent me from trying to make a "blocking" event
loop. I'm still working on this; my current thoughts are to make a separate
thread do the keyboard and mouse reads in blocking mode, and to make the
main TV thread wait on a semaphore. Calls to idle() would be issued every
second or so by a semaphore timeout. Any ideas would be welcome..
* You can use TV in a multithread program, but ALL calls / references to ANY
TV class must be made from only ONE thread. No locking is done at ALL within
the Turbo Vision code, and it would not even help if it did. Making TV
multithread would really be a lot of work and would very much change the
way it worked from an application (need "thread anchor blocks" and the like).
* My first port of Turbo Vision was for version 1.3. This version took a long
time to port, not because the porting was difficult but because the original
code contained a zillion bugs. These surfaced because OS/2 provides memory
protection. The port of 2.0 worked almost instantly, so I have not currently
checked what bugs still remained from the original version.
* The patched code also changes the interface to Windows NT & dos
compatibility. I am not working for/with either, so these patches will
probably cause problems for the DOS and NT versions of TV. Make sure you have
a backup; and if you have to use both the OS/2 and some other version you'll
have to do some work yourself.. The main reasons for this are in changes.log.
* The Multi-compiler interface still sucks.
Installing
----------
You'll need the following to make this version:
* This package & the stuff to decompress it.
* The original Turbo Vision 2.0 source code, as provided with the Borland
Powerpack for DOS 1.0.
* GNU PATCH 2.6. This program will apply the patches specified in the DIFF
file to the original sources. It can be found on many BBS's or internet
(hobbes).
* Either the Borland C++ compiler or the WatCOM 10.0a compiler. C Set/2 will
not immediately work.
Make a subdirectory 'prj' somewhere. This is the base for all TV projects
(and can already exist in your file structure). This subdirectory MUST be
specified in the INCLUDE paths of your compiler, i.e.
SET INCLUDE=......\prj or -I...prj.
Below PRJ, create a TVISION subdirectory and copy the original TV source code
(found in the compiler directory SOURCE\TVISION) here.
Copy all TV header files from your compiler's INCLUDE\TVISION directory also
to PRJ\TVISION, so that both sources and headers are in the same directory.
Make the PRJ directory the current directory, then pkunzip -D this package. It
will create some new subdirectories (CPL, TVDEMO), and it will expand some
other files into the TV directory.
Use the GNU PATCH command to patch the source code. Make PRJ\TVISION the
current directory, then use
patch < patches.dif
to patch all files.
After this, check for any .REJ files in this directory. If PATCH cannot patch
a file it will generate a .REJ file for this file containing the patch it
could not make. If this happens you're in trouble: you either don't have the
correct source code, an incorrect version of PATCH OR you have a source file
that contains TAB's with some strange expansion size! Either patch by hand or
try again after solving something...
Ok, now you should have compilable code. Make yourself some dandy makefile
for the project and go. I do not provide a makefile (I do not use make) but
a list of sources can be found in TV.PPP. Take heed: not all assembler modules
must be used, and the modules Tmenupop.cpp and Smenupop.cpp must not be used
either. Of course you can also use the BC IDE.
You can also use the tools in the subdirectory TOOLS, named MKLIB and TCM, to
build the library and to compile programs using the library. To use these,
read the README in the TOOLS directory.
The options I've used for the Borland C++ compiler are:
bcc -c -sm -D__32BITS__ -d -N -w-sig -v -k -Od -r -Vo- -o(obj name)
tasm /s/z/t/ml/p -D__FLAT__
I use the Borland 1.5 compiler; I have not upgraded to 2.0 because Borland
was so very supportive for it's OS/2 customers.. For this compiler I have
the following tips:
* Don't use the optimizer! Dont! Really! Lots of trouble I've had with this
compiler was really the optimizer doing it's best. The only set of
optimize options I've found to work reasonably well is
-Od -Ob -Oc -Ot -r
Pay special attention to the -r above: don't EVER compile C++ code with
-r-. One of the effects of compiling with -r- (disable registers) is
that register variables (ESI, EDI) are not saved in the function prolog.
This seems logical since they shouldn't be used anyway. But the startup
code of the Borland C++ 1.5 code uses the ESI register to keep something
like the "list of constructor lists" when __startup calls all global
constructors. The result is that when some constructor of a globally
instanciated class uses ESI the program traps before main() is called.
This had me completely baffled, more so because the great Borland
debugger kept dying when this occured. I had to use the WatCOM debugger
to find this out. I really am getting very fond of the WatCOM compiler!!
For the WatCOM compiler the options I use are:
wpp386 -bm -d__32BITS__ -bt=os2 -d2 -e25 -fh -fo=(obj name) -j -mf -5r -w4 -zq
* Currently you'll need TASM to compile the assembler stuff for WatCOM
because WASM doesn't comprehend some directives in the assembler source.
After compiling the library, try to compile and link the TVDEMO sources
provided. They should compile & link without problems. The sources are taken
from the Turbo Vision stuff, but some changes were made for functions that
are not provided with other compilers.