|##########|
|#MAGIC   #|CLABLLLJ
|#PROJECT #|"IMPORTALL"
|#PATHS   #|"StdProject"
|#FLAGS   #|xx---x--x---xxx-----------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|x----x----------
|##########|
DEFINITION MODULE Layers;


FROM Graphics   IMPORT ClipRectPtr,BitMapPtr,LayerFlagSet,LayerInfoPtr,
                       LayerPtr,RastPortPtr,RegionPtr,Rectangle;
FROM Utility    IMPORT HookPtr;
FROM Exec       IMPORT LibraryPtr;
FROM System     IMPORT Regs,LONGSET;

TYPE
  LayerMessagePtr = POINTER TO LayerMessage;
  LayerMessage    = RECORD
                      layer    : LayerPtr;
                      bounds   : Rectangle;
                      xoffset,
                      yoffset  : INTEGER;
                    END;


VAR LayersBase : LibraryPtr;

LIBRARY LayersBase BY  -78
  PROCEDURE BeginUpdate(l IN A0 : LayerPtr);

LIBRARY LayersBase BY  -54
  PROCEDURE BehindLayer(l IN A1 : LayerPtr);

LIBRARY LayersBase BY  -42
  PROCEDURE CreateBehindLayer(li    IN A0  : LayerInfoPtr;
                              bm    IN A1  : BitMapPtr;
                              x0    IN D0,
                              y0    IN D1,
                              x1    IN D2,
                              y1    IN D3  : LONGINT;
                              flags IN D4  : LayerFlagSet;
                              bm2   IN A2 : BitMapPtr):LayerPtr;

LIBRARY LayersBase BY -186
  PROCEDURE CreateUpfrontHookLayer(li      IN A0 : LayerInfoPtr;
                                   bm      IN A1 : BitMapPtr;
                                   x0      IN D0 : LONGINT;
                                   y0      IN D1 : LONGINT;
                                   x1      IN D2 : LONGINT;
                                   y1      IN D3 : LONGINT;
                                   flags   IN D4 : LayerFlagSet;
                                   hook    IN A3 : HookPtr;
                                   superbm IN A2 : BitMapPtr):LayerPtr;

LIBRARY LayersBase BY  -36
  PROCEDURE CreateUpfrontLayer(li    IN A0  : LayerInfoPtr;
                               bm    IN A1  : BitMapPtr;
                               x0    IN D0,
                               y0    IN D1,
                               x1    IN D2,
                               y1    IN D3  : LONGINT;
                               flags IN D4  : LONGSET;
                               bm2   IN A2  : BitMapPtr):LayerPtr;

LIBRARY LayersBase BY -192
  PROCEDURE CreateBehindHookLayer(li      IN A0 : LayerInfoPtr;
                                  bm      IN A1 : BitMapPtr;
                                  x0      IN D0 : LONGINT;
                                  y0      IN D1 : LONGINT;
                                  x1      IN D2 : LONGINT;
                                  y1      IN D3 : LONGINT;
                                  flags   IN D4 : LayerFlagSet;
                                  hook    IN A3 : HookPtr;
                                  superbm IN A2 : BitMapPtr):LayerPtr;

LIBRARY LayersBase BY  -90
  PROCEDURE DeleteLayer(l IN A1 : LayerPtr);

LIBRARY LayersBase BY -150
  PROCEDURE DisposeLayerInfo(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY  -84
  PROCEDURE EndUpdate(l    IN A0 : LayerPtr;
                      flag IN D0 : BOOLEAN);

LIBRARY LayersBase BY -156
  PROCEDURE FattenLayerInfo(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY  -30
  PROCEDURE InitLayers(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY -174
  PROCEDURE InstallClipRegion(l      IN A0 : LayerPtr;
                              region IN A1 : RegionPtr):RegionPtr;

LIBRARY LayersBase BY  -96
  PROCEDURE LockLayer(l IN A1 : LayerPtr);

LIBRARY LayersBase BY -120
  PROCEDURE LockLayerInfo(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY -108
  PROCEDURE LockLayers(li IN A0 : LayerInfoPtr),

LIBRARY LayersBase BY  -60
  PROCEDURE MoveLayer(l  IN A1 : LayerPtr;
                      dx IN D0,
                      dy IN D1 : LONGINT);

LIBRARY LayersBase BY -168
  PROCEDURE MoveLayerInFrontOf(l      IN A0,
                               target IN A1 : LayerPtr);

LIBRARY LayersBase BY -144
  PROCEDURE NewLayerInfo():LayerInfoPtr;

LIBRARY LayersBase BY  -72
  PROCEDURE ScrollLayer(l  IN A1 : LayerPtr;
                        dx IN D0,
                        dy IN D1 : LONGINT);

LIBRARY LayersBase BY  -66
  PROCEDURE SizeLayer(l  IN A1 : LayerPtr;
                      dx IN D0,
                      dy IN D1 : LONGINT);

LIBRARY LayersBase BY -180
  PROCEDURE MoveSizeLayer(layer IN A0 : LayerPtr;
                          dx    IN D0 : LONGINT;
                          dy    IN D1 : LONGINT;
                          dw    IN D2 : LONGINT;
                          dh    IN D3 : LONGINT):BOOLEAN;

LIBRARY LayersBase BY -126
  PROCEDURE SwapBitsRastPortClipRect(rp IN A0 : RastPortPtr;
                                     cr IN A1 : ClipRectPtr);

LIBRARY LayersBase BY -162
  PROCEDURE ThinLayerInfo(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY -102
  PROCEDURE UnlockLayer(l IN A0 : LayerPtr);

LIBRARY LayersBase BY -138
  PROCEDURE UnlockLayerInfo(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY -114
  PROCEDURE UnlockLayers(li IN A0 : LayerInfoPtr);

LIBRARY LayersBase BY  -48
  PROCEDURE UpfrontLayer(l IN A1 : LayerPtr);

LIBRARY LayersBase BY -132
  PROCEDURE WhichLayer(li IN A0 : LayerInfoPtr;
                       x  IN D0,
                       y  IN D1 : LONGINT):LayerPtr;

LIBRARY LayersBase BY -198
  PROCEDURE InstallLayerHook(layer IN A0 : LayerPtr;
                             hook  IN A1 : HookPtr):HookPtr;

END Layers.

