			     NORTON SHADOWS

Clipper Developers

If you are like me and like high intensity backgrounds, you probably also
like NORTON product shadows - very see through.

Here are two 'C' versions of the same routine that will create the Norton
like shadows for your Clipper boxes, dialogs etc. Shadow.c uses the 
extend.api, gt.api fm.api and vmshad.c uses the vm.api instead of fm.api.

Both versions are based upon the examples included in the gt.api in the
new API docs. I had plenty of problems with the example shadow function as
supplied in the API docs, but hope I have figured it out correctly. Well
it works for me .... I had to change a reference from FARP to BYTEP to get
it to even compile.

If I'm wrong I would appreciate, you guys with better C skills than me
pointing me to where I went wrong.

Just as a comment here, even though I have provided a vm example I can't
see any reason to use vm here.  Even with close to a full screen box we
are only xalloc...ing a very small amount of memory approx. 200 bytes.
The API docs guideline says if you are allocating over 256 bytes use vm
not fm.

The following is for those who want to know how it works.  If you don't
care just use it as follows, change where appropriate if not using FUNCky.
Make sure you use a high intensity background color or it will just look
like any other shadow you have seen before.

Function Main()
  SetBlink(.f.)
  SetShadow(.f.)
  Cls(159)
  Box(2,2,22,77)
  Shadow(2,2,22,77)
  Inkey(0)
Return(Nil)


The way the Norton shadows work is the following.

If the background color is low intensity then they work the same as normal
shadows. However if you have a high intensity background with a high
intensity foreground then both the blink bit and high intensity bit are
turned off, leaving you with the same colour, low intensity back ground
and low intensity foreground

Eg clear the screen with 159 or high White/high Blue - bit wise
representation of 159 is 1001 1111 = 159 or 128+16+8+4+2+1. If we turn off
bits 3 and 7 we get 0001 0111 or 16+4+2+1 = 23, which is low White/low
Blue.

If the background intensity is low, but the foreground intensity is high
we leave the background intensity alone, but turn off the foreground high
intensity.

Eg clear the screen with 31 or High White/low Blue - bit wise
representation of 31 is 0001 1111 = 31 or 16+8+4+2+1. If this time we turn
off bit 3 we get 0001 0111 = 23 or 16+4+2+1, the same as above.

If both the background intensity bit and the foreground intensity bit are
low we just set the colour to 8 or 0000 1000, just like other shadows.

Files included
vmshad.c
vmshad.obj
shadow.c
shadow.obj
shadow.txt
