WWIN 2.0
========

Copyright (C) 1996 by Frank Heckenbach.
Partly based on some units, Copyright 1989-92 by Borland International Inc.

DESCRIPTION:
------------
The unit WWin is an extension of the Crt unit coming with Borland Pascal.
It works on all three platforms that BP 7.0 supports, i.e. Real Mode,
Protected Mode and Windoze.

The main purpose of WWin is to make porting Crt based applications to
Windoze easy. For most purposes it should suffice to replace the
"Uses Crt" directive by "Uses WWin". If there are any problems, see
the list of differences below.

The program is distributed as SHAREWARE. You may use it privately for
a testing period of no more than three weeks. If you use this software
beyond the testing period, or for any non-private purposes, you must
register. Read the "Legal stuff" below and, especially, the file
REGISTER.TXT, included in this archive, for details.

WWin should run with Turbo Pascal 6.0 in Real Mode and with BP 7.0
on all three platforms. The interface for all three platforms is nearly
identical. That means, you do not have to change much to switch your
program from Dos to Windoze and back. Even more, you can easily write
programs that compile on all three platforms.

Of course, there are many special features, exceeding the standard Crt
routines, especially for Windoze, that can help to adapt the program's
behaviour. If you want to use them in a program that runs on the other
platforms, too, you can put those commands within conditional defines.

All this is shown in the accompanying WWinDemo program. If you read its
source (WWinDemo.Pas), you will soon see how to use the features.
The executable (WWinDemo.Exe) actually consists of two executables, put
together with D. J. Murdoch's Glue program v. 1.0 (Copyright 1991), one
for Dos and one for Windoze. So you get different programs whether you
call it from Dos or from Windoze. But as you will see, both versions do
nearly the same. This illustrates the interface compatibility of WWin.

The file WWIN.INT contains the interface part of the unit.
The documentation of all the routines, types, constants and variables
is written in this file directly behind their declarations.
The documentation is often quite short. I hope most routines should be
self-explanatory. If not, you can ask me for more detailed explanations.
Note that many routines come from the Crt and/or WinCrt units and are
thus covered in BP's online help and manuals.

WWin uses the WinProcs and WinTypes units if compiled for Windoze, and
no other units (except System, of course) in real and protected mode.
This means, it needs SYSTEM.TPU/.TPP/.TPW, WINTYPES.TPW and WINPROCS.TPW,
all contained within TURBO.TPL/TPP.TPL/TPW.TPL normally.

The compiled version of WWin should fit with the (unmodified) versions
of these files from TP 6.0, BP 7.0 and BP 7.01. If they don't, tell me -
I've got only a limited amount of testing capabilities in this respect.

I also included a TP 6.0 version (WWIN.T60 - must be renamed to WWIN.TPU).
(This might not be so interesting because TP 6.0 is only for Real Mode.)

I am not sure about TPW 1.5. If its unit format is compatible with BP 7.0,
it should be no problem to use WWIN.TPW. Otherwise, I cannot create a
TPW 1.5 file, since I don't have this compiler. If you use TPW 1.5 and
are able to use WWIN.TPW, I would be glad for a short note.

If you have any hints, suggestions or error reports, I will be interested
to hear from you.

DIFFERENCES FROM THE STANDARD UNITS:
------------------------------------
The following lists the differences of WWin from the standard Crt and
WinCrt units. As you will see, they are very few, minor, and can easily
be circumvented in your programs.

Which parts of Crt are not supported under Windoze and how can they
be changed? (Note: All of the following are still available like
in Crt for the Real and Protected Mode versions.)

- TextMode, LastMode

  There are no such things as different text modes under Windoze.
  Instead you can use the SetTextSizes function which gives even
  more possibilities than the text modes. You can read the current
  settings back with GetTextSizes.

- Sound, NoSound

  If you want to play sounds, you should look for sound units for
  Windoze or sound related Windoze API calls. Playing sounds has
  not (yet) been a topic of interest to this unit.
  If you just want to do a "beep", use the Bell procedure (also
  available under Dos).

- DirectVideo, CheckSnow

  Not needed for Windoze.

Which parts of Crt have been changed (Real and Protected Mode):

- TextMode

  This procedure works like the one in the Crt unit.
  Additionally you can use any non-standard text mode supported by your
  graphic card. To do this, you have to add the constant AnyMode to the
  number of the mode, e.g. to use mode $54, call Textmode(AnyMode+$54).
  You can get a list of supported video modes from your graphic card's
  manual. Note, however, that bad use of this function might do damage
  to your graphic hardware (graphic card and/or monitor). I did not
  have problems on my system, though, but in no case will I be liable
  for any damage. Also note that using non-standard modes might make
  your programs incompatible with other computer systems.

Which parts of WinCrt have been changed (Windoze):

- WriteChar

  This procedure was renamed to WriteChr because Win contains another
  function of the name WriteChar.

FILES:
------
README.TXT    This file
REGISTER.TXT  How to get licensed to use the unit
WWIN.INT      Interface part of WWin, together with documentation
WWIN.T60      Compiled Real Mode version for TP 6.0
WWIN.TPU      Compiled Real Mode version for BP 7.0
WWIN.TPP      Compiled Protected Mode version for BP 7.0
WWIN.TPW      Compiled Windoze version for BP 7.0
WWINDEMO.PAS  Example program - source code
WWINDEMO.EXE  Example program - executable for Dos and Windoze

VERSIONS:
---------
1.0 Ported most Crt and Win features including extensions to Win for Real
    Mode I had made before to Windoze extending WinCrt

1.1 + User timer functions

1.2 Combined Real Mode and Windoze versions to one file with (nearly)
    identical interface for both platforms

1.3 + Graphic mode support (Real Mode and Windoze)

1.4 + Support for different screen and pixel sizes in graphic mode
      under Windoze

2.0 First published version as Shareware
    + Protected Mode support
    + Support for different screen and font sizes in text mode under Windoze
    + Palette routines for graphic mode for all platforms
    Speeded up graphic display under Windoze by using bitmaps
    Some minor bugs fixed

LEGAL STUFF:
------------
Copyright:
The WWin unit and the WWinDemo program (both below referred to as
"the software") as well as all files included in this archive are
Copyright (C) 1996 by Frank Heckenbach (referred to as "the author").
The author is free to make new versions, or alter the software in
any way, at any time, with or without announcement.
WWin is partly based on some units, Crt, Win and WinCrt, which are
Copyright 1989-92 by Borland International, Inc.

Disclaimer:
This software is distributed AS IS in the hope that it will be useful,
but WITHOUT ANY WARRANTY, expressed or implied; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I tried to fix all bugs that I could find. However, these days is it
not possible to write error-free software with justifiable expenditure.
The author shall not be liable for any damages, whether direct, indirect,
special, incidental or consequential arising from the use of the software
or from the inability to use the software or from a failure of the
software to operate in a manner desired by the user. The author shall
not be liable for any damage to data or property which may by caused
directly or indirectly by use of the software. In no event will the
author be liable to you for any damages, including any lost profits,
lost savings or other incidental or consequential damages arising out
of your use or inability to use the software, or for any claim by any
other party. Individuals using the software bear all risk as to its
quality and performance.

Distribution:
The author gives the right to distribute the shareware form of the
software package in an electronic form, as long as there is not a direct
charge for the distribution. This includes posting the software on WWW
sites, copying the file via magnetic media, such as diskettes or CD-ROM,
and electronic transmission. But the archive must be distributed in its
COMPLETE, UNMODIFIED form. If you upload the software somewhere, I will
be glad for a note (preferred by Email), so I can inform you or the site
directly about future releases. If you wish to distribute the software
for profit, you must contact the author for a distribution license.
An explicit exception of the right to distribute the software applies
to the Microsoft Network. The software, or any part of it, whether in
unmodified or modified form, as well as any program that was written
using the software, may not be offered by any site on the Microsoft
Network publicly for redistribution, except sites that are official,
direct or indirect, mirrors of the Simtel.Net and/or Garbo archives.
Microsoft is hereby granted the right to pay the author US$500.00 to
distribute the software in unmodified form via the Microsoft Network.
Any distribution of the software constitutes acceptance of these terms.

Usage (Shareware):
The software is distributed as SHAREWARE. You may use the software for
private purposes for a testing period no longer than three weeks without
registration. Any other use, including using the software longer than
three weeks, or ever again after the testing period, or for any commercial
or non-private purpose, requires a registration of the software.

The price of a registration for private use is 25.00 DM (German Marks)
at the current time (April 96). The author is free to change the price
whenever he wants. A registration for private use permits the following:

a) Personal, private use by one individual on one single-processor
   computer at any given time.

b) Getting the source code of the software.

c) Using the software to write programs for personal use or for
   distribution for free. This includes public domain and freeware
   programs. For the present, this applies also to programs that are
   distributed as SHAREWARE with a registration fee of no more than
   US$25.00.
   Note, that you may NOT give away the source code of the software
   that you receive, under any circumstances, whether modified or
   unmodified. You may, however, distribute the shareware version
   of WWin together with your programs, according to the above said
   about distribution, especially distributing the archive in
   complete and unmodified form.

d) Modifying the software for personal use. But you may NOT give away
   any modified version of the software in any form, whether as source
   code or in compiled form without express permission by the author.
   You may, however, distribute compiled programs that were written
   using a modified version of the software, according to c).
   In short: distribution of the modified software inside an .EXE is
   allowed, distribution as a .PAS or .TPU/.TPP/.TPW file is not.

   (I recommend and request that you contact me if you make any
   significant changes that might be useful to others, so these
   changes might be included in future releases of the software.)

To register for private use, read the file REGISTER.TXT, included in
this archive, fill in the form contained in this file, and send it to me.

Registration for private use does in particular not permit the following:

- Using the software by a company, institution or similar.
  Licenses for this purpose can also be obtained. If you need these,
  contact me directly, describing your needs.

- Using the software for any commercial purpose (exception: see under c).
  Any commercial use of the software must be explicitly allowed by the
  author and will usually require payment of a royalty to the author.
  In short: If the software becomes part of a program that is sold for
  profit, then the author shall participate in this profit.
  When this is planned, contact me to discuss further details.

Using the software on multi-processor computers or networks is allowed
if one license was registered for every processor in the computer resp.
on any computer in the network that the software is used on.
However, in these cases it will usually be more convenient to get a
site license. Contact me directly, describing your situation, for
information about that.

Trademarks:
Turbo Pascal and Borland Pascal are a registered trademarks of
Borland International, Inc.
Microsoft Network is a trademark of Microsoft Corporation.
Windoze is not a trademark ;-)

Frank Heckenbach
Email: heckenb@mi.uni-erlangen.de
       alternatively: fn106@fim.uni-erlangen.de
