[Main]
Name=GraySetInt1Handler
Alias=SetGrayInt1Handler
Type=Function
Subtype=Macro
Header Files=gray.h
Definition=void GraySetInt1Handler (INT_HANDLER handler);
Real Definition=#define GraySetInt1Handler(p) ((void)(__gray_hw_type ? ((INT_HANDLER)__gray_old_int1_hw2 = (p)) : ((INT_HANDLER)__gray_old_int1_hw1 = (p))))
See Also=gray.h/GrayGetInt1Handler, intr.h/

[Description]
Sets the interrupt handler executed by the grayscale algorithm.

[Explanation]
GraySetInt1Handler sets the interrupt handler which is called internally by
the grayscale support to <I>handler</I>. Using this function, you can
redirect this interrupt even in grayscale mode.
<BR><BR>
The interrupt handler called by the grayscale routines looks something like this
(pseudo-code):
<PRE>DEFINE_INT_HANDLER (GrayInt1Handler)
{
  SwitchPlanes ();
  ExecuteHandler (OldInt1);
}
</PRE>
where <I>OldInt1</I> is the previous <A HREF="$$LINK(intr.h/IntVecs)">AUTO_INT_1</A> handler.
GraySetInt1Handler sets the value of <I>OldInt1</I> to <I>handler</I>.
Note that this is just a C-style declaration of the <A HREF="$$LINK(intr.h/IntVecs)">AUTO_INT_1</A>
handler for grayscale; the actual one is implemented in assembly.
<BR><BR>
<B>Note:</B> Always reset the handler to the previous value (returned by
<A HREF="$$LINK(gray.h/GrayGetInt1Handler)">GrayGetInt1Handler</A>) before turning
off grayscale, otherwise it will be installed as a permanent interrupt handler.
