Difference between revisions of "Layers.library"

From Freepascal Amiga wiki
Jump to navigation Jump to search
(Added correct links to original c-sources, changed example titles to be more appropiate and added descriptions where possible.)
m (→‎the unit: Removed copy-paste-error: Uses clause mytagsarray->tagsarray)
Line 124: Line 124:
  
 
Uses
 
Uses
   mytagsarray;
+
   tagsarray;
  
  

Revision as of 10:28, 22 October 2013

Layers.library

[insert background information here]


examples

Example: layerstest

A collection of assorted layers functions is used in this test.

Original c-source [1]

Pascal code will follow.

Example: clippingtest

A collection of layers functions that focuses on clipping.

Original c-source [2]

Pascal code will follow.

Example: CRList

ClipRects and their usage.

Original c-source [3]

Pascal code will follow.

Example: DamageList

Original c-source [4]

Pascal code will follow.

Example: Lens

Shows how to use a ScaleLayer() callback hook.

Original c-source [5]

Pascal code will follow.


the unit

Unit layers;

{$MODE OBJFPC}{$H+}{$PACKRECORDS C}

Interface

Uses
  CTypes, exec, agraphics, utility;


Const
  LAYERSNAME : PChar = 'layers.library';
Var
  LayersBase : pLibrary;



  Procedure InitLayers(li: pLayer_Info);
  Function  CreateUpfrontLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap): pLayer;
  Function  CreateBehindLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap): pLayer;
  Function  UpfrontLayer(dummy: LongInt; l: pLayer): LongInt;
  Function  BehindLayer(dummy: LongInt; l: pLayer): LongInt;
  Function  MoveLayer(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt): LongInt;
  Function  SizeLayer(dummy: LongInt; l: pLayer; dw: LongInt; dh: LongInt): LongInt;
  Procedure ScrollLayer(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt);
  Function  BeginUpdate(l: pLayer): LongInt;
  Procedure EndUpdate(l: pLayer; flag: Word);
  Function  DeleteLayer(dummy: LongInt; l: pLayer): LongInt;
  Procedure LockLayer(dummy: LongInt; layer: pLayer);
  Procedure UnlockLayer(layer: pLayer);
  Procedure LockLayers(li: pLayer_Info);
  Procedure UnlockLayers(li: pLayer_Info);
  Procedure LockLayerInfo(li: pLayer_Info);
  Procedure SwapBitsRastPortClipRect(rp: pRastPort; cr: pClipRect);
  Function  WhichLayer(li: pLayer_Info; x: LongInt; y: LongInt): pLayer;
  Procedure UnlockLayerInfo(li: pLayer_Info);
  Function  NewLayerInfo(): pLayer_Info;
  Procedure DisposeLayerInfo(li: pLayer_Info);
  Function  FattenLayerInfo(li: pLayer_Info): LongInt;
  Procedure ThinLayerInfo(li: pLayer_Info);
  Function  MoveLayerInFrontOf(layer_to_move: pLayer; other_layer: pLayer): LongInt;
  Function  InstallClipRegion(l: pLayer; region: pRegion): pRegion;
  Function  MoveSizeLayer(l: pLayer; dx: LongInt; dy: LongInt; dw: LongInt; dh: LongInt): LongInt;
  Function  CreateUpfrontHookLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap): pLayer;
  Function  CreateBehindHookLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap): pLayer;
  Function  InstallLayerHook(layer: pLayer; hook: pHook): pHook;
  Function  InstallLayerInfoHook(li: pLayer_Info; hook: pHook): pHook;
  Procedure SortLayerCR(layer: pLayer; dx: LongInt; dy: LongInt);
  Procedure DoHookClipRects(hook: pHook; rport: pRastPort; rect: pRectangle);
  // aros extension
  Function  CreateLayerTagList(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; tagList: pTagItem): pLayer;
  Function  GetFirstFamilyMember(l: pLayer): pLayer;
  Function  ChangeLayerVisibility(l: pLayer; visible: cint): LongInt;
  Function  IsLayerVisible(l: pLayer): LongInt;
  Function  ChangeLayerShape(l: pLayer; newshape: pRegion; callback: pHook): pRegion;
  Function  ScaleLayer(l: pLayer; taglist: pTagItem): LongWord;
  Function  IsFrontmostLayer(l: pLayer; check_invisible: LongBool): LongBool;
  Function  IsLayerHiddenBySibling(l: pLayer; check_invisible: LongBool): LongBool;
  Procedure CollectPixelsLayer(l: pLayer; r: pRegion; callback: pHook);
  // aros extension - varargs
  Function  CreateLayerTags(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; const tags: Array Of Const): pLayer; inline;
  Function  ScaleLayerTags(l: pLayer; const tags: Array of Const): LongWord; inline;



Implementation

Uses
  tagsarray;


Procedure InitLayers(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 5));
  Call(li, LayersBase);
End;


Function  CreateUpfrontLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 6));
  CreateUpfrontLayer := Call(li, bm, x0, y0, x1, y1, flags, bm2, LayersBase);
End;


Function  CreateBehindLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; bm2: pBitMap; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 7));
  CreateBehindLayer := Call(li, bm, x0, y0, x1, y1, flags, bm2, LayersBase);
End;


Function  UpfrontLayer(dummy: LongInt; l: pLayer): LongInt;
Type
  TLocalCall = Function(dummy: LongInt; l: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 8));
  UpfrontLayer := Call(dummy, l, LayersBase);
End;


Function  BehindLayer(dummy: LongInt; l: pLayer): LongInt;
Type
  TLocalCall = Function(dummy: LongInt; l: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 9));
  BehindLayer := Call(dummy, l, LayersBase);
End;


Function  MoveLayer(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt): LongInt;
Type
  TLocalCall = Function(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 10));
  MoveLayer := Call(dummy, l, dx, dy, LayersBase);
End;


Function  SizeLayer(dummy: LongInt; l: pLayer; dw: LongInt; dh: LongInt): LongInt;
Type
  TLocalCall = Function(dummy: LongInt; l: pLayer; dw: LongInt; dh: LongInt; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 11));
  SizeLayer := Call(dummy, l, dw, dh, LayersBase);
End;


Procedure ScrollLayer(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt);
Type
  TLocalCall = Procedure(dummy: LongInt; l: pLayer; dx: LongInt; dy: LongInt; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 12));
  Call(dummy, l, dx, dy, LayersBase);
End;


Function  BeginUpdate(l: pLayer): LongInt;
Type
  TLocalCall = Function(l: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 13));
  BeginUpdate := Call(l, LayersBase);
End;


Procedure EndUpdate(l: pLayer; flag: Word);
Type
  TLocalCall = Procedure(l: pLayer; flag: Word; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 14));
  Call(l, flag, LayersBase);
End;


Function  DeleteLayer(dummy: LongInt; l: pLayer): LongInt;
Type
  TLocalCall = Function(dummy: LongInt; l: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 15));
  DeleteLayer := Call(dummy, l, LayersBase);
End;


Procedure LockLayer(dummy: LongInt; layer: pLayer);
Type
  TLocalCall = Procedure(dummy: LongInt; layer: pLayer; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 16));
  Call(dummy, layer, LayersBase);
End;


Procedure UnlockLayer(layer: pLayer);
Type
  TLocalCall = Procedure(layer: pLayer; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 17));
  Call(layer, LayersBase);
End;


Procedure LockLayers(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 18));
  Call(li, LayersBase);
End;


Procedure UnlockLayers(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 19));
  Call(li, LayersBase);
End;


Procedure LockLayerInfo(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 20));
  Call(li, LayersBase);
End;


Procedure SwapBitsRastPortClipRect(rp: pRastPort; cr: pClipRect);
Type
  TLocalCall = Procedure(rp: pRastPort; cr: pClipRect; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 21));
  Call(rp, cr, LayersBase);
End;


Function  WhichLayer(li: pLayer_Info; x: LongInt; y: LongInt): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; x: LongInt; y: LongInt; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 22));
  WhichLayer := Call(li, x, y, LayersBase);
End;


Procedure UnlockLayerInfo(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 23));
  Call(li, LayersBase);
End;


Function  NewLayerInfo(): pLayer_Info;
Type
  TLocalCall = Function(LibBase: Pointer): pLayer_Info; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 24));
  NewLayerInfo := Call(LayersBase);
End;


Procedure DisposeLayerInfo(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 25));
  Call(li, LayersBase);
End;


Function  FattenLayerInfo(li: pLayer_Info): LongInt;
Type
  TLocalCall = Function(li: pLayer_Info; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 26));
  FattenLayerInfo := Call(li, LayersBase);
End;


Procedure ThinLayerInfo(li: pLayer_Info);
Type
  TLocalCall = Procedure(li: pLayer_Info; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 27));
  Call(li, LayersBase);
End;


Function  MoveLayerInFrontOf(layer_to_move: pLayer; other_layer: pLayer): LongInt;
Type
  TLocalCall = Function(layer_to_move: pLayer; other_layer: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 28));
  MoveLayerInFrontOf := Call(layer_to_move, other_layer, LayersBase);
End;


Function  InstallClipRegion(l: pLayer; region: pRegion): pRegion;
Type
  TLocalCall = Function(l: pLayer; region: pRegion; LibBase: Pointer): pRegion; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 29));
  InstallClipRegion := Call(l, region, LayersBase);
End;


Function  MoveSizeLayer(l: pLayer; dx: LongInt; dy: LongInt; dw: LongInt; dh: LongInt): LongInt;
Type
  TLocalCall = Function(l: pLayer; dx: LongInt; dy: LongInt; dw: LongInt; dh: LongInt; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 30));
  MoveSizeLayer := Call(l, dx, dy, dw, dh, LayersBase);
End;


Function  CreateUpfrontHookLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 31));
  CreateUpfrontHookLayer := Call(li, bm, x0, y0, x1, y1, flags, hook, bm2, LayersBase);
End;


Function  CreateBehindHookLayer(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; hook: pHook; bm2: pBitMap; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 32));
  CreateBehindHookLayer := Call(li, bm, x0, y0, x1, y1, flags, hook, bm2, LayersBase);
End;


Function  InstallLayerHook(layer: pLayer; hook: pHook): pHook;
Type
  TLocalCall = Function(layer: pLayer; hook: pHook; LibBase: Pointer): pHook; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 33));
  InstallLayerHook := Call(layer, hook, LayersBase);
End;


Function  InstallLayerInfoHook(li: pLayer_Info; hook: pHook): pHook;
Type
  TLocalCall = Function(li: pLayer_Info; hook: pHook; LibBase: Pointer): pHook; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 34));
  InstallLayerInfoHook := Call(li, hook, LayersBase);
End;


Procedure SortLayerCR(layer: pLayer; dx: LongInt; dy: LongInt);
Type
  TLocalCall = Procedure(layer: pLayer; dx: LongInt; dy: LongInt; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 35));
  Call(layer, dx, dy, LayersBase);
End;


Procedure DoHookClipRects(hook: pHook; rport: pRastPort; rect: pRectangle);
Type
  TLocalCall = Procedure(hook: pHook; rport: pRastPort; rect: pRectangle; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 36));
  Call(hook, rport, rect, LayersBase);
End;


Function  CreateLayerTagList(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; tagList: pTagItem): pLayer;
Type
  TLocalCall = Function(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; tagList: pTagItem; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 37));
  CreateLayerTagList := Call(li, bm, x0, y0, x1, y1, flags, tagList, LayersBase);
End;


Function  GetFirstFamilyMember(l: pLayer): pLayer;
Type
  TLocalCall = Function(l: pLayer; LibBase: Pointer): pLayer; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 38));
  GetFirstFamilyMember := Call(l, LayersBase);
End;


Function  ChangeLayerVisibility(l: pLayer; visible: cint): LongInt;
Type
  TLocalCall = Function(l: pLayer; visible: cint; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 39));
  ChangeLayerVisibility := Call(l, visible, LayersBase);
End;


Function  IsLayerVisible(l: pLayer): LongInt;
Type
  TLocalCall = Function(l: pLayer; LibBase: Pointer): LongInt; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 40));
  IsLayerVisible := Call(l, LayersBase);
End;


Function  ChangeLayerShape(l: pLayer; newshape: pRegion; callback: pHook): pRegion;
Type
  TLocalCall = Function(l: pLayer; newshape: pRegion; callback: pHook; LibBase: Pointer): pRegion; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 41));
  ChangeLayerShape := Call(l, newshape, callback, LayersBase);
End;


Function  ScaleLayer(l: pLayer; taglist: pTagItem): LongWord;
Type
  TLocalCall = Function(l: pLayer; taglist: pTagItem; LibBase: Pointer): LongWord; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 42));
  ScaleLayer := Call(l, taglist, LayersBase);
End;


Function  IsFrontmostLayer(l: pLayer; check_invisible: LongBool): LongBool;
Type
  TLocalCall = Function(l: pLayer; check_invisible: LongBool; LibBase: Pointer): LongBool; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 43));
  IsFrontmostLayer := Call(l, check_invisible, LayersBase);
End;


Function  IsLayerHiddenBySibling(l: pLayer; check_invisible: LongBool): LongBool;
Type
  TLocalCall = Function(l: pLayer; check_invisible: LongBool; LibBase: Pointer): LongBool; cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 44));
  IsLayerHiddenBySibling := Call(l, check_invisible, LayersBase);
End;


Procedure CollectPixelsLayer(l: pLayer; r: pRegion; callback: pHook);
Type
  TLocalCall = Procedure(l: pLayer; r: pRegion; callback: pHook; LibBase: Pointer); cdecl;
Var
  Call : TLocalCall;
Begin
  Call := TLocalCall(GetLibAdress(LayersBase, 45));
  Call(l, r, callback, LayersBase);
End;





Function  CreateLayerTags(li: pLayer_Info; bm: pBitMap; x0: LongInt; y0: LongInt; x1: LongInt; y1: LongInt; flags: LongInt; const tags: Array Of Const): pLayer;
begin
  CreateLayerTags := CreateLayerTagList(li, bm, x0, y0, x1, y1, flags, readintags(tags));
end;

Function  ScaleLayerTags(l: pLayer; const tags: Array of Const): LongWord;
begin
  ScaleLayerTags := ScaleLayer(l, readintags(tags));
end;




Initialization
  LayersBase := OpenLibrary(LayersName, 0);


Finalization
  CloseLibrary(LayersBase);

End.

unit documentation

A bit rough around the edges. No var /var was done, and only some basic links to other units (types etc.).

<?xml version="1.0"?>
<fpdoc-descriptions>
  <package name="arosrtl">
    <module name="layers">
      <element name="LAYERSNAME">
        <short>The disk/memory name of the layers.library.</short>
      </element>
      <element name="LayersBase">
        <short>Placeholder for a pointer to an opened layers.library.</short>
      </element>
      <element name="InitLayers">
        <short>
          <b>OBSOLETE</b> Initialize Layer_Info structure.</short>
        <descr>
          <p>Initializes the supplied Layer_Info, so it's ready for use. Leaves the Layer_Info in an unlocked state.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>This function is obsolete. Use <link id="NewLayerInfo"/> instead.</p>
        </descr>
        <errors>
          <p>This function is obsolete. Use <link id="NewLayerInfo"/> instead.</p>
        </errors>
        <seealso>
          <link id="NewLayerInfo"/>
        </seealso>
      </element>
      <element name="InitLayers.li">
        <short>Pointer to Layer_Info structure.</short>
      </element>
      <element name="CreateUpfrontLayer">
        <short>Create a new layer on top of existing layers.</short>
      </element>
      <element name="CreateUpfrontLayer.Result">
        <short>Pointer to layer if successful, Nil otherwise.</short>
      </element>
      <element name="CreateUpfrontLayer.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateUpfrontLayer.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateUpfrontLayer.x0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateUpfrontLayer.y0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateUpfrontLayer.x1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateUpfrontLayer.y1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateUpfrontLayer.flags">
        <short>Choose the type of layer by setting some flags.</short>
      </element>
      <element name="CreateUpfrontLayer.bm2">
        <short>Pointer to optional super bitmap.</short>
      </element>
      <element name="CreateBehindLayer">
        <short>Create a new layer behind all existing layers.</short>
        <descr>
          <p>Create a new layer at the given position and with the given size. The new layer will be in front of all other layers. If it is a backdrop layer it will be created in front of all other backdrop layers and behind all non backdrop layers.</p>
        </descr>
      </element>
      <element name="CreateBehindLayer.Result">
        <short>Pointer to the newly created layer. Nil if layer could not be created (Probably out of memory).</short>
      </element>
      <element name="CreateBehindLayer.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateBehindLayer.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateBehindLayer.x0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateBehindLayer.y0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateBehindLayer.x1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateBehindLayer.y1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateBehindLayer.flags">
        <short>Choose the type of layer by setting some flags.</short>
      </element>
      <element name="CreateBehindLayer.bm2">
        <short>Pointer to optional super bitmap.</short>
      </element>
      <element name="UpfrontLayer">
        <short>Put layer in front of all other layers.</short>
        <descr>
          <p>Brings a layer to the front. If this layer is a backdrop layer it is brought in front of all backdrop layers and behind the last non-backdrop layer. By clearing the BACKDROP flag of a layer a backdrop layer can be brought in front of all other layers.</p>
          <p>Parts of a simple layer that become visible are added to the damage list and the REFRESH flag is set.</p>
        </descr>
      </element>
      <element name="UpfrontLayer.Result">
        <short>Returns how function succeeded.</short>
        <descr>
          <p>Returns a boolean state which establishes whether the layer has moved upfront.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer was moved.
  
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer could not be moved (probably out of memory).
</p>
        </descr>
      </element>
      <element name="UpfrontLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="UpfrontLayer.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="BehindLayer">
        <short>Put layer behind other layers.</short>
        <descr>
          <p>If the layer is a backdrop layer it will be moved to the most behind position. If it is a non-backdrop layer it will be moved in front of the first backdrop layer.</p>
          <p>The areas of simple layers, that become visible by moving this layer, are added to the damagelist and the LAYERREFRESH flag is set.</p>
        </descr>
      </element>
      <element name="BehindLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the function was Successful.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer was successfully moved
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer could not be moved (probably out of memory).
</p>
        </descr>
      </element>
      <element name="BehindLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="BehindLayer.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="MoveLayer">
        <short>Move layer to new position in BitMap.</short>
        <descr>
          <p>Moves the layer to a specified position in the bitmap.</p>
          <p>Parts of simple layers that become visible are added to the damage list and a refresh is triggered.</p>
        </descr>
        <seealso>
          <link id="AGraphics.TLayer"/>
          <link id="AGraphics.TClipRect"/>
        </seealso>
      </element>
      <element name="MoveLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer has moved.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - everything went alright.
            <br/>
            <link id="Exec.LFalse">LFalse</link> - an error occured (out of memory).
</p>
        </descr>
      </element>
      <element name="MoveLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="MoveLayer.l">
        <short>Pointer to layer to be moved.</short>
      </element>
      <element name="MoveLayer.dx">
        <short>Delta to add to current x position.</short>
      </element>
      <element name="MoveLayer.dy">
        <short>Delta to add to current y position</short>
      </element>
      <element name="SizeLayer">
        <short>Change the size of this nonbackdrop layer.</short>
        <descr>
          <p>Resizes the given layer by adding dw to its width and dh to its height.</p>
          <p>If parts of simple layers become visible those parts are added to the damage list and a refresh is triggered for those layers.</p>
          <p>If the new layer is bigger than before the additional parts are added to a damage list if the layer is a non-superbitmap layer. Refresh is also triggered for this layer.</p>
        </descr>
      </element>
      <element name="SizeLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer has been resized.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer could be resized.
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - an error occured (out of memory).
</p>
        </descr>
      </element>
      <element name="SizeLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="SizeLayer.l">
        <short>Pointer to layer to be resized.</short>
      </element>
      <element name="SizeLayer.dw">
        <short>Delta to be added to the width.</short>
      </element>
      <element name="SizeLayer.dh">
        <short>Delta to be added to the height.</short>
      </element>
      <element name="ScrollLayer">
        <short>Scroll around in a superbitmap, translate coordinates in non-superbitmap layer.</short>
        <descr>
          <p>For superbitmapped layers this function work like this: It updates the contents of the superbitmap with what is visible on the display, repositions the superbitmap and redraws the display.</p>
          <p>For non-superbitmapped layers, all subsequent (x,y) pairs are adjusted by the scroll(x,y) value in the layer. If ScrollLayer(-10,-3) was called and (0,0) is drawn it will finally end up at coordinates (10, 3) in the superbitmap.</p>
        </descr>
        <errors>
          <p>May not handle (dx,dy) which attempts to move the layer outside the layer's SuperBitMap bounds.</p>
        </errors>
      </element>
      <element name="ScrollLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="ScrollLayer.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="ScrollLayer.dx">
        <short>Delta x to add to current x scroll value.</short>
      </element>
      <element name="ScrollLayer.dy">
        <short>Delta y to add to current y scroll value.</short>
      </element>
      <element name="BeginUpdate">
        <short>Prepare to repair damaged layer.</short>
        <descr>
          <p>Converts the damage list to ClipRects and exchanges the two lists for faster redrawing. This routine allows a faster update of the display as it will only be rendered in the damaged areas.</p>
          <p>This routine will automatically lock the layer to prevent changes.</p>
        </descr>
        <errors>
          <p>If BeginUpdate returns 
<link id="Exec.LFalse">LFalse</link>, programmer must abort the attempt to refresh this layer and instead call EndUpdate( l, 
<link id="Exec.LFalse">LFalse</link>) to restore original 
<link id="AGraphics.TClipRect">ClipRect</link> and damage list.
</p>
        </errors>
        <seealso>
          <link id="EndUpdate"/>
        </seealso>
      </element>
      <element name="BeginUpdate.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the function was Successful.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> if damage list conversion was successful
            <br/>
            <link id="Exec.LFalse">LFalse</link> if list could not be converted.
</p>
        </descr>
      </element>
      <element name="BeginUpdate.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="EndUpdate">
        <short>Remove damage list and restore state of layer to normal.</short>
        <descr>
          <p>After the damaged areas are update this routine should be called so the regular cliprects of the layer can be installed.</p>
        </descr>
        <seealso>
          <link id="BeginUpdate"/>
        </seealso>
      </element>
      <element name="EndUpdate.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="EndUpdate.flag">
        <short>Determines wheter the update was complete or partial. LTrue if the update was complete. The damage list is disposed. LFalse it the update was partial. The damage list is kept.</short>
      </element>
      <element name="DeleteLayer">
        <short>Delete a layer from layer list.</short>
        <descr>
          <p>Deletes the layer. Other layers that were hidden (partially) will become visible. If parts of a simple layer become visible those parts are added to the damagelist of the layer and the LAYERREFRESH flags is set.</p>
        </descr>
      </element>
      <element name="DeleteLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the function was Successful.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer was successfuly deleted
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer could not be deleted (put of memory).
</p>
        </descr>
      </element>
      <element name="DeleteLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="DeleteLayer.l">
        <short>Layer to be deleted.</short>
      </element>
      <element name="LockLayer">
        <short>Lock layer to make changes to ClipRects.</short>
        <descr>
          <p>Locks a layer for exclusive access by this task. A layer can be locked multiple times but has to be unlocked as many times as it has been locked so that other tasks can access it.</p>
        </descr>
        <seealso>
          <link id="UnlockLayer"/>
          <link id="LockLayerInfo"/>
          <link id="UnlockLayerInfo"/>
          <link id="AGraphics.LockLayerRom"/>
          <link id="AGraphics.pLayer"/>
          <link id="AGraphics.pClipRect"/>
        </seealso>
      </element>
      <element name="LockLayer.dummy">
        <short>Unused.</short>
      </element>
      <element name="LockLayer.layer">
        <short>Pointer to a layer to be locked.</short>
      </element>
      <element name="UnlockLayer">
        <short>Unlock layer and allow graphics routines to use it.</short>
        <descr>
          <p>Unlocks a layer for access by other tasks. A layer has to be unlocked as many times as it has been locked until another task can access it.</p>
        </descr>
      </element>
      <element name="UnlockLayer.layer">
        <short>Pointer to layer to be unlocked.</short>
      </element>
      <element name="LockLayers">
        <short>Lock all layers from graphics output.</short>
        <descr>
          <p>First locks the Layer_Info then all the layers that are found in the list of layers.</p>
        </descr>
        <seealso>
          <link id="LockLayer"/>
          <link id="LockLayerInfo"/>
          <link id="AGraphics.TLayer_Info"/>
        </seealso>
      </element>
      <element name="LockLayers.li">
        <short>Pointer to a Layer_Info structure.</short>
      </element>
      <element name="UnlockLayers">
        <short>Unlock all layers from graphics output. Restart graphics output to layers that have been waiting.</short>
        <descr>
          <p>First unlocks all layers found in the list, then unlocks the Layer_Info itself.</p>
        </descr>
        <seealso>
          <link id="LockLayers"/>
          <link id="UnlockLayer"/>
        </seealso>
      </element>
      <element name="UnlockLayers.li">
        <short>Unlock the LayerInfo structure.</short>
      </element>
      <element name="LockLayerInfo">
        <short>Lock the LayerInfo structure.</short>
        <descr>
          <p>Before doing an operation that requires the LayerInfo structure, make sure that no other task is also using the LayerInfo structure. LockLayerInfo returns when the LayerInfo belongs to this task. There should be an UnLockLayerInfo for every LockLayerInfo.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>All layer routines presently LockLayerInfo() when they start up and UnlockLayerInfo as they exit. Programmers will need to use these Lock/Unlock routines if they wish to do something with the LayerStructure that is not supported by the layers library.</p>
        </descr>
        <seealso>
          <link id="UnlockLayerInfo"/>
          <link id="AGraphics.TLayer_Info"/>
        </seealso>
      </element>
      <element name="LockLayerInfo.li">
        <short>Pointer to Layer_Info structure.</short>
      </element>
      <element name="SwapBitsRastPortClipRect">
        <short>Swap bits between common bitmap and obscured ClipRect.</short>
        <descr>
          <p>Support routine for those that need to do some operations not done by the layer library. Allows programmer to swap the contents of a small BitMap with a subsection of the display. This is accomplished without using extr memory.</p>
          <p>The bits in the display RastPort are exchanged with the bits in the ClipRect's Bitmap.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>The ClipRect structures which the layer library allocates are actually a little bigger than those described in the graphics/clip.h include file. So be warned that it is not a good idea to have instances of cliprects in you code.</p>
        </descr>
      </element>
      <element name="SwapBitsRastPortClipRect.rp">
        <short>Pointer to rastport.</short>
      </element>
      <element name="SwapBitsRastPortClipRect.cr">
        <short>Pointer to cliprect to swap bits with.</short>
      </element>
      <element name="WhichLayer">
        <short>Which layer is this point in ?</short>
        <descr>
          <p>Determines in which layer the point (x,y) is to be found. Starts with the frontmost layer.</p>
        </descr>
      </element>
      <element name="WhichLayer.Result">
        <short>Pointer to the topmost layer that this point is in or nil if this point is not in a layer.</short>
      </element>
      <element name="WhichLayer.li">
        <short>Pointer to Layers_Info structure.</short>
      </element>
      <element name="WhichLayer.x">
        <short>X-coordinate.</short>
      </element>
      <element name="WhichLayer.y">
        <short>Y-coordinate.</short>
      </element>
      <element name="UnlockLayerInfo">
        <short>Unlock the LayerInfo structure.</short>
        <descr>
          <p>After the operation is complete that required a LockLayerInfo, unlock the LayerInfo structure so that other tasks may affect the layers.</p>
        </descr>
        <seealso>
          <link id="LockLayerInfo"/>
        </seealso>
      </element>
      <element name="UnlockLayerInfo.li">
        <short>Pointer to the Layer_Info structure.</short>
      </element>
      <element name="NewLayerInfo">
        <short>Allocate and Initialize full Layer_Info structure.</short>
        <descr>
          <p>Allocate memory required for full Layer_Info structure.</p>
          <p>Initialize Layer_Info structure in preparation to use other layer operations on this list of layers.</p>
          <p>Make the Layer_Info unlocked (open).</p>
        </descr>
        <seealso>
          <link id="AGraphics.TLayerInfo"/>
        </seealso>
      </element>
      <element name="NewLayerInfo.Result">
        <descr>Returns a pointer to Layer_Info structure if successful or Nil is not enough memory.</descr>
      </element>
      <element name="DisposeLayerInfo">
        <short>Return all memory for LayerInfo to memory pool.</short>
        <descr>
          <p>return LayerInfo and any other memory attached to this LayerInfo to memory allocator.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>If you wish to delete the layers associated with this Layer_Info structure, remember to call DeleteLayer for each of the layers before calling DisposeLayerInfo.</p>
        </descr>
      </element>
      <element name="DisposeLayerInfo.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="FattenLayerInfo">
        <short>
          <b>OBSOLETE</b> Convert 1.0 LayerInfo to 1.1 LayerInfo</short>
        <descr>
          <p>This function is <b>OBSOLETE</b>
          </p>
          <p>V1.1 software and any later releases need to have more info in the Layer_Info structure. To do this in a 1.0 supportable manner requires allocation and deallocation of the memory whenever most layer library functions are called. To prevent unnecessary allocation/deallocation FattenLayerInfo will preallocate the necessary data structures and fake out the layer library into thinking it has a LayerInfo gotten from NewLayerInfo.</p>
          <p>NewLayerInfo is the approved method for getting this structure.</p>
          <p>When a program needs to give up the LayerInfo structure it must call ThinLayerInfo before freeing the memory. ThinLayerInfo is not necessary if NewLayerInfo/DisposeLayerInfo are used however.</p>
        </descr>
        <errors>
          <p>This function is OBSOLETE</p>
        </errors>
        <seealso>
          <link id="NewLayerInfo"/>
          <link id="ThinLayerInfo"/>
          <link id="DisposeLayerInfo"/>
          <link id="AGraphics.pLayerInfo"/>
        </seealso>
      </element>
      <element name="FattenLayerInfo.Result">
        <short/>
      </element>
      <element name="FattenLayerInfo.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="ThinLayerInfo">
        <short>
          <b>OBSOLETE</b> Convert 1.1 LayerInfo to 1.0 LayerInfo</short>
        <descr>
          <p>This function is <b>OBSOLETE</b>
          </p>
          <p>return the extra memory needed that was allocated with FatteLayerInfo. This is must be done prior to freeing the Layer_Info structure itself. V1.1 software should be using DisposeLayerInfo.</p>
        </descr>
        <errors>
          <p>This function is OBSOLETE</p>
        </errors>
      </element>
      <element name="ThinLayerInfo.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="MoveLayerInFrontOf">
        <short>Put layer in front of another layer.</short>
        <descr>
          <p>Moves layer directly in front of another layer. Other layers might become visible. You cannot move a backdrop layer in front of a non-backdrop layer. You can also not move a layer in front of a layer with different relationship to the root layer. Boot have to be children of grandchildren or grandgrandchildren etc. of the root layer. The root layer is not visible to you and should never be accessed.</p>
          <p>If parts of a simple layer become visible these areas are added to the damage list.</p>
        </descr>
        <seealso>
          <link id="AGraphics.TLayer_Info"/>
        </seealso>
      </element>
      <element name="MoveLayerInFrontOf.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer has moved.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer was moved.
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer could not be moved (probably out of memory).
</p>
        </descr>
      </element>
      <element name="MoveLayerInFrontOf.layer_to_move">
        <short>Pointer to layer that is to be moved.</short>
      </element>
      <element name="MoveLayerInFrontOf.other_layer">
        <short>Pointer to other layer that will be behind the layer_to_move.</short>
      </element>
      <element name="InstallClipRegion">
        <short>Install clip region in layer.</short>
        <descr>
          <p>Install a transparent Clip region in the layer. All subsequent graphics calls to the rastport of the layer will be clipped to that region.</p>
          <p>None of the system functions will free the ClipRegion for you, so you will have to call InstallClipRegion(l, Nil) before closing a window or deleting a layer.</p>
        </descr>
        <seealso>
          <link id="BeginUpdate"/>
          <link id="EndUpdate"/>
          <link id="AGraphics.pLayer_Info"/>
          <link id="AGraphics.pClipRect"/>
          <link id="AGraphics.pClipRegion"/>
        </seealso>
      </element>
      <element name="InstallClipRegion.Result">
        <short>Pointer to old clip region.</short>
        <descr>
          <p>Returns the pointer to the previous ClipRegion that was installed. Return Nil if no previous ClipRegion installed.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>If the system runs out of memory while computing the resulting ClipRects the LAYERS_CLIPRECTS_LOST bit will be set in l^.Flags.</p>
        </descr>
        <errors>
          <p>If the system runs out of memory during normal operations, the <link id="AGraphics/TClipRect ">ClipRect</link> list may get swept away and not restored.</p>
          <p>As soon as there is enough memory and the layer library gets called again the <link id="AGraphics/TClipRect ">ClipRect</link>list will be rebuilt.</p>
        </errors>
      </element>
      <element name="InstallClipRegion.l">
        <short>Pointer to a layer.</short>
      </element>
      <element name="InstallClipRegion.region">
        <short>Pointer to region to be clipped against.</short>
      </element>
      <element name="MoveSizeLayer">
        <short>Position/Size layer.</short>
        <descr>
          <p>Moves and resizes the layer in one step. Collects damage lists for those layers that become visible and are simple layers.</p>
          <p>If the layer to be moved is becoming larger the additional areas are added to a damagelist if it is a non-superbitmap layer. Refresh is also triggered for this layer.</p>
        </descr>
        <seealso>
          <link id="AGraphics.TLayerInfo"/>
          <link id="AGraphics.TClipRect"/>
        </seealso>
      </element>
      <element name="MoveSizeLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer has moved and resized.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - everything went alright.
  
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - an error occured (out of memory).
</p>
        </descr>
      </element>
      <element name="MoveSizeLayer.l">
        <short>Pointer to layer to be moved.</short>
      </element>
      <element name="MoveSizeLayer.dx">
        <short>Delta to add to current x position.</short>
      </element>
      <element name="MoveSizeLayer.dy">
        <short>Delta to add to current y position.</short>
      </element>
      <element name="MoveSizeLayer.dw">
        <short>Delta to add to current width.</short>
      </element>
      <element name="MoveSizeLayer.dh">
        <short>Delta to add to current height.</short>
      </element>
      <element name="CreateUpfrontHookLayer">
        <short>Create a new layer on top of existing layers, using supplied callback BackFill hook.</short>
        <descr>
          <p>Create a new layer at the given position and with the given size. The new layer will be in front of all other layers. If it is a backdrop layer it will be created in front of all other backdrop layers and behind all non backdrop layers.</p>
          <p>Install the given hook as a backfill hook. This hook will be called whenever a part of the layer is supposed to be filled with a certain pattern. The backfill hook has to do that.</p>
          <p>If a super bitmap layer is wanted the flags LAYERSUPER and the flag LAYERSMART have to be set and a pointer to a bitmap must also be passed to this function.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>Does not allow to create layers that are partially outside the given bitmap (, yet).</p>
        </descr>
      </element>
      <element name="CreateUpfrontHookLayer.Result">
        <short>Pointer to layer if successful, Nil otherwise.</short>
      </element>
      <element name="CreateUpfrontHookLayer.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateUpfrontHookLayer.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateUpfrontHookLayer.x0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateUpfrontHookLayer.y0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateUpfrontHookLayer.x1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateUpfrontHookLayer.y1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateUpfrontHookLayer.flags">
        <short>Choose the type of layer by setting some flags.</short>
      </element>
      <element name="CreateUpfrontHookLayer.hook">
        <short>Pointer to the backfill hook of this layer.</short>
        <descr>
          <p>The backfill hook will be called with<br/>
object = pRastPort(result^.RastPort<br/>) 
and message = [ pLayer(layer), tRectangle(bounds), WORD(offsetx), WORD(offsety) ]
</p>
        </descr>
      </element>
      <element name="CreateUpfrontHookLayer.bm2">
        <short>Pointer to optional super bitmap.</short>
      </element>
      <element name="CreateBehindHookLayer">
        <short>Create a new layer behind all existing layers, using supplied callback BackFill hook.</short>
        <descr>
          <p>Create a new layer at the given position and with the given size. The new layer will be in front of all other layers. If it is a backdrop layer it will be created in front of all other backdrop layers and behind all non backdrop layers.</p>
          <p>Install the given hook as a backfill hook. This hook will be called whenever a part of the layer is supposed to be filled with a certain pattern. The backfill hook has to do that.</p>
          <p>If a super bitmap layer is wanted the flags LAYERSUPER and the flag LAYERSMART have to be set and a pointer to a bitmap must also be passed to this function.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>Does not allow to create layers that are partially outside the given bitmap (, yet).</p>
        </descr>
      </element>
      <element name="CreateBehindHookLayer.Result">
        <short>Pointer to the newly created layer. Nil if layer could not be created (Probably out of memory).</short>
      </element>
      <element name="CreateBehindHookLayer.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateBehindHookLayer.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateBehindHookLayer.x0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateBehindHookLayer.y0">
        <short>Upper left corner of the layer.</short>
      </element>
      <element name="CreateBehindHookLayer.x1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateBehindHookLayer.y1">
        <short>Lower right corner of the layer.</short>
      </element>
      <element name="CreateBehindHookLayer.flags">
        <short>Choose the type of layer by setting some flags.</short>
      </element>
      <element name="CreateBehindHookLayer.hook">
        <short>Pointer to the backfill hook of this layer.</short>
        <descr>
          <p>The backfill hook will be called with<br/>
object = pRastPort(result^.RastPort<br/>) 
and message = [ pLayer(layer), tRectangle(bounds), WORD(offsetx), WORD(offsety) ]
</p>
        </descr>
      </element>
      <element name="CreateBehindHookLayer.bm2">
        <short>Pointer to optional super bitmap.</short>
      </element>
      <element name="InstallLayerHook">
        <short>Safely install a new backfill hook.</short>
        <descr>
          <p>Safely install a new backfill hook. Return the old hook.</p>
          <p>If hook is Nil, then the default backfill hook will be installed.</p>
        </descr>
      </element>
      <element name="InstallLayerHook.Result">
        <short>Pointer to a (previous installed) hook.</short>
        <descr>
          <p>Pointer to the Layer^.BackFill Hook that was previously active. Returns Nil if it was the default hook.</p>
          <p>In V39, it could return 1 if there was no hook.</p>
        </descr>
      </element>
      <element name="InstallLayerHook.layer">
        <short>Layer that will get the new backfill hook.</short>
      </element>
      <element name="InstallLayerHook.hook">
        <short>Pointer to backfill hook to be installed.</short>
      </element>
      <element name="InstallLayerInfoHook">
        <short>Install a backfill hook for non-layer.</short>
        <descr>
          <p>Install a backfill hook into the LayerInfo structure. This backfill hook will be called to clear the areas where there is no layer. It will be used for every layer.</p>
          <p>
            <b>Notes:</b>
          </p>
          <p>The hook is not called immediately. It will be called for those areas that have to be cleared when layers move away from those areas.</p>
        </descr>
        <seealso>
          <link id="InstallLayerHook"/>
        </seealso>
      </element>
      <element name="InstallLayerInfoHook.Result">
        <short>Pointer to a (previous installed) hook.</short>
        <descr>
          <p>If there was a backfill hook installed before it will be returned. LAYERS_BACKFILL will be returned if the default backfill hook was installed, LAYERS_NOBACKFILL if there was nothing to be called for clearing an area.</p>
        </descr>
      </element>
      <element name="InstallLayerInfoHook.li">
        <short>Pointer to LayerInfo.</short>
      </element>
      <element name="InstallLayerInfoHook.hook">
        <short>Pointer to a callback Hook which will be called.</short>
        <descr>
          <p>The Hook will be called with object = pRastPort(result^.RastPort) and message = [ LongWord(undefined), TRectangle(bounds) ].</p>
          <p>This hook should fill the Rectangle in the RastPort with the BackFill pattern appropiate for rectangle given.</p>
          <p>If hook is LAYERS_BACKFILL, the default backfill is used. (Same as pre-2.0).</p>
          <p>If hook is LAYERS_NOBACkFILL, there will be no backfill. (<b>No-op</b>)</p>
        </descr>
      </element>
      <element name="SortLayerCR">
        <short>Sort ClipRects in layer.</short>
        <descr>
          <p>Sorts the list of ClipRects associated with the given layer.</p>
          <p>The direction of the sort is indicated by dx and dy.</p>
          <p>
            <b>Result:</b>
          </p>
          <p>The layer^.ClipRect pointer now points to a sorted list of ClipRects.</p>
          <p>
            <b>Internals:</b>
          </p>
          <p>Implemented as an InsertSort on a singly linked list.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="SortLayerCR.layer">
        <short>The layer with the ClipRect list to sort</short>
      </element>
      <element name="SortLayerCR.dx">
        <short>The left/right ordering.</short>
      </element>
      <element name="SortLayerCR.dy">
        <short>The up/down ordering.</short>
      </element>
      <element name="DoHookClipRects">
        <short>Do the given hook for each of the ClipRects.</short>
        <descr>
          <p>This function will call the given hook for each ClipRect in the layer that can be rendered into. This is how the backfill hook in Layers is implemented. This means that hidden simple-refresh cliprects will be ignored. It will call the SuperBitmap cliprects, smart refresh off-screen cliprects, and all on screen cliprects.</p>
          <p>If the rect parameter is not Nil, the cliprects are bounded to the rectangle given.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="DoHookClipRects.hook">
        <short>Pointer to the hook to be called for the cliprects of the given layer.</short>
      </element>
      <element name="DoHookClipRects.rport">
        <short>No operation is allowed outside this rectangle. If a layer is bigger than this rectangle only operations in the common area are allowed.</short>
      </element>
      <element name="DoHookClipRects.rect">
        <short>Pointer to the rastport where the layers upon which the hook is to be called.</short>
      </element>
      <element name="CreateLayerTagList">
        <short>Create a new layer according to the given taglist.</short>
        <descr>
          <remark>? This function is introduced in AROS.?</remark>
          <p/>
          <table border="1">
            <th>
              <td>TagItem</td>
              <td/>
              <td>Description</td>
            </th>
            <tr>
              <td valign="top">LA_PRIORITY</td>
              <td valign="top">:</td>
              <td valign="top">
                <p>priority class of the layer.</p>
                <p>The higher the number the further the layer will be in front of everything else.</p>
                <p>Default value is UPFRONTPRIORITY.</p>
              </td>
            </tr>
            <tr>
              <td>LA_HOOK</td>
              <td>:</td>
              <td>Backfill hook</td>
            </tr>
            <tr>
              <td>LA_SUPERBITMAP</td>
              <td>:</td>
              <td>
                <p>pointer to a superbitmap.</p>
                <p>The flags must also represent that this layer is supposed to be a superbitmap layer.</p>
              </td>
            </tr>
            <tr>
              <td>LA_CHILDOF</td>
              <td>:</td>
              <td>
                <p>pointer to parent layer. </p>
                <p>If Nil then this layer will be created as a old-style layer.</p>
              </td>
            </tr>
            <tr>
              <td>LA_INFRONTOF</td>
              <td>:</td>
              <td>pointer to a layer in front of which this layer is to be created.</td>
            </tr>
            <tr>
              <td>LA_BEHIND</td>
              <td>:</td>
              <td>
                <p>pointer to a layer behind which this layer is to be created.</p>
                <p>Must not give both LA_INFRONTOF and LA_BEHIND.</p>
              </td>
            </tr>
            <tr>
              <td>LA_VISIBLE</td>
              <td>:</td>
              <td>
                <p>LFalse if this layer is to be invisible.</p>
                <p>Default value is LTrue</p>
              </td>
            </tr>
            <tr>
              <td>LA_SHAPE</td>
              <td>:</td>
              <td>
                <p>The region of the layer that comprises its shape.</p>
                <p>This value is optional.</p>
                <p>The region must be relative to the layer.</p>
              </td>
            </tr>
          </table>
        </descr>
      </element>
      <element name="CreateLayerTagList.Result">
        <descr>
          <p>Pointer to the newly created layer. Nil if layer could not be created (Probably out of memory).</p>
          <p>If the layer is created successful you must not free its shape. The shape is automatically freed when the layer is deleted.</p>
        </descr>
      </element>
      <element name="CreateLayerTagList.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateLayerTagList.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateLayerTagList.x0">
        <short>Upper left corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTagList.y0">
        <short>Upper left corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTagList.x1">
        <short>Lower right corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTagList.y1">
        <short>Lower right corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTagList.flags">
        <short>Choose the type of layer by setting some flags.   If it is to be a super bitmap layer then the tag LA_SUPERBITMAP must be provided along with a pointer to a valid super bitmap.</short>
      </element>
      <element name="CreateLayerTagList.tagList">
        <short>A list of tags that specify the properties of the layer.</short>
      </element>
      <element name="GetFirstFamilyMember">
        <short>Gets the first member of a layer family.</short>
        <descr>
          <p>Gets the first member of a layer family. If the layer has no children at all this function returns the pointer to the same layer as given. If the layer has children which again have children etc. this function returns the frontmost child.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="GetFirstFamilyMember.Result">
        <short>Pointer to layer structure.</short>
        <descr>
          <p>Pointer to a layer structure that represents the frontmost child of the given layer or the layer itself if it has no children.</p>
        </descr>
      </element>
      <element name="GetFirstFamilyMember.l">
        <short>Pointer to a layer structure.</short>
      </element>
      <element name="ChangeLayerVisibility">
        <short>Changes the visibility of a layer.</short>
        <descr>
          <p>Makes the given layer visible or invisible.</p>
          <p>If it is a simple refresh layer it will loose all its cliprects and therefore rendering will go into the void.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="ChangeLayerVisibility.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the function was Successful.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer was changed to new state
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer could not be changed to new state.
</p>
        </descr>
      </element>
      <element name="ChangeLayerVisibility.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="ChangeLayerVisibility.visible">
        <short>LTrue or LFalse.</short>
      </element>
      <element name="IsLayerVisible">
        <short>Determines whether the layer is visible or not.</short>
        <descr>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="IsLayerVisible.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer is visible.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer is visible.
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer is invisible.
</p>
        </descr>
      </element>
      <element name="IsLayerVisible.l">
        <short>Pointer to a layer.</short>
      </element>
      <element name="ChangeLayerShape">
        <short>Changes shape of layer.</short>
        <descr>
          <p>Changes the shape of the layer on the fly.</p>
          <p>When the shape of a layer is changed the current pixel content is copied into its ClipRects so no information is lost.</p>
          <p>The user can provide a callback hook that will be called when the current layer's information is all backed up in ClipRects. The signature of the callback should look as follows:</p>
          <code>Function CallBack(hook: pHook; l: pLayer; arg: pScaleLayerParam): pRegion; cdecl;</code>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="ChangeLayerShape.Result">
        <short>Pointer to the previously installed region.</short>
      </element>
      <element name="ChangeLayerShape.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="ChangeLayerShape.newshape">
        <short>Pointer to a region that comprises the new shape of the layer. May be Nil if callback is provided.</short>
      </element>
      <element name="ChangeLayerShape.callback">
        <short>Pointer to a callback hook. May be Nil if newshape is given.</short>
      </element>
      <element name="ScaleLayer">
        <short>Scale a layer.</short>
        <descr>
          <p>Scale the given layer. This function will use the current shape of the layer and resize it according to the given newwidth/newheight.</p>
          <remark>? This function is introduced in AROS.?</remark>
          <table border="1">
            <th>
              <td>TagItem</td>
              <td/>
              <td>Description</td>
            </th>
            <tr>
              <td>LA_DESTWIDTH</td>
              <td>:</td>
              <td>Destination width of layer to scale</td>
            </tr>
            <tr>
              <td>LA_DESTHEIGHT</td>
              <td>:</td>
              <td>Destination height of layer to scale</td>
            </tr>
          </table>
        </descr>
      </element>
      <element name="ScaleLayer.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer was scaled.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - everything went alright.
  
  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - otherwise.
</p>
        </descr>
      </element>
      <element name="ScaleLayer.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="ScaleLayer.taglist">
        <short>Pointer to a list of tags.</short>
        <descr>
          <p>Possible tagitems are:<br/>
newwidth    - new width of the layer<br/>
newheight   - new height of the layer<br/>
          </p>
        </descr>
      </element>
      <element name="IsFrontmostLayer">
        <short>Determines if layer is the frontmost layer.</short>
        <descr>
          <p>Checks whether this layer is the frontmost layer within its priority.</p>
          <p>If this layer has children then all of its children will be disregarded. Comparisons are only done with layers that have the same 'depth' of relationship (=nesting counter) to the root layer.</p>
          <p>It can be specified whether invisible siblings are to be considered in the comparison.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="IsFrontmostLayer.Result">
        <descr>
          <p>Returns a boolean which establishes whether the layer is frontmost.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer is frontmost layer within its priority.

  
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer is not frontmost layer within its priority.
</p>
        </descr>
      </element>
      <element name="IsFrontmostLayer.l">
        <short>Pointer to a layer.</short>
      </element>
      <element name="IsFrontmostLayer.check_invisible">
        <short>Whether invisible siblings are to be considered.</short>
      </element>
      <element name="IsLayerHiddenBySibling">
        <short>Determines if layer is hidden by sibling.</short>
        <descr>
          <p>Checks whether this layer is hidden by any siblings that are in front of it. All these siblings must have the same priority as that layer.</p>
          <p>It can be specified whether invisible siblings are to be considered in the comparison.</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="IsLayerHiddenBySibling.Result">
        <descr>
          <p>Returns a boolean which establishes whether the layer is hidden by a sibbling.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - layer is hidden by one or more sibblings.
            <br/>
            <link id="Exec.LFalse">LFalse</link> - layer is fully visible.
</p>
        </descr>
      </element>
      <element name="IsLayerHiddenBySibling.l">
        <short>Pointer to a layer.</short>
      </element>
      <element name="IsLayerHiddenBySibling.check_invisible">
        <short>Whether invisible siblings are to be considered.</short>
      </element>
      <element name="CollectPixelsLayer">
        <short>Collect pixels of a layer.</short>
        <descr>
          <p>This function collects all the pixel within region r and calls the provided callback hook for all areas that were found. You can do with the pixels whatever you want...</p>
          <remark>? This function is introduced in AROS.?</remark>
        </descr>
      </element>
      <element name="CollectPixelsLayer.l">
        <short>Pointer to layer where to start out.</short>
      </element>
      <element name="CollectPixelsLayer.r">
        <short>Region where to look for hidden or visible pixels.</short>
      </element>
      <element name="CollectPixelsLayer.callback">
        <short>Callback function.</short>
        <descr>
          <p>Callback function.</p>
          <p>The callback will be invoked for the found pixels along with information about the size of the area that may be copied.
</p>
        </descr>
      </element>
      <element name="CreateLayerTags">
        <short>Create a new layer according to the tags given.</short>
        <descr>
          <remark>? This function is introduced in AROS.?</remark>
          <p/>
          <table border="1">
            <th>
              <td>TagItem</td>
              <td/>
              <td>Description</td>
            </th>
            <tr>
              <td valign="top">LA_PRIORITY</td>
              <td valign="top">:</td>
              <td valign="top">
                <p>priority class of the layer.</p>
                <p>The higher the number the further the layer will be in front of everything else.</p>
                <p>Default value is UPFRONTPRIORITY.</p>
              </td>
            </tr>
            <tr>
              <td>LA_HOOK</td>
              <td>:</td>
              <td>Backfill hook</td>
            </tr>
            <tr>
              <td>LA_SUPERBITMAP</td>
              <td>:</td>
              <td>
                <p>pointer to a superbitmap.</p>
                <p>The flags must also represent that this layer is supposed to be a superbitmap layer.</p>
              </td>
            </tr>
            <tr>
              <td>LA_CHILDOF</td>
              <td>:</td>
              <td>
                <p>pointer to parent layer. </p>
                <p>If Nil then this layer will be created as a old-style layer.</p>
              </td>
            </tr>
            <tr>
              <td>LA_INFRONTOF</td>
              <td>:</td>
              <td>pointer to a layer in front of which this layer is to be created.</td>
            </tr>
            <tr>
              <td>LA_BEHIND</td>
              <td>:</td>
              <td>
                <p>pointer to a layer behind which this layer is to be created.</p>
                <p>Must not give both LA_INFRONTOF and LA_BEHIND.</p>
              </td>
            </tr>
            <tr>
              <td>LA_VISIBLE</td>
              <td>:</td>
              <td>
                <p>LFalse if this layer is to be invisible.</p>
                <p>Default value is LTrue</p>
              </td>
            </tr>
            <tr>
              <td>LA_SHAPE</td>
              <td>:</td>
              <td>
                <p>The region of the layer that comprises its shape.</p>
                <p>This value is optional.</p>
                <p>The region must be relative to the layer.</p>
              </td>
            </tr>
          </table>
        </descr>
      </element>
      <element name="CreateLayerTags.Result">
        <descr>
          <p>Pointer to the newly created layer. Nil if layer could not be created (Probably out of memory).</p>
          <p>If the layer is created successful you must not free its shape. The shape is automatically freed when the layer is deleted.</p>
        </descr>
      </element>
      <element name="CreateLayerTags.li">
        <short>Pointer to LayerInfo structure.</short>
      </element>
      <element name="CreateLayerTags.bm">
        <short>Pointer to common bitmap.</short>
      </element>
      <element name="CreateLayerTags.x0">
        <short>Upper left corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTags.y0">
        <short>Upper left corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTags.x1">
        <short>Lower right corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTags.y1">
        <short>Lower right corner of the layer (in parent layer coords).</short>
      </element>
      <element name="CreateLayerTags.flags">
        <short>Choose the type of layer by setting some flags.     If it is to be a super bitmap layer then the tag LA_SUPERBITMAP must be provided along with a pointer to a valid super bitmap.</short>
      </element>
      <element name="CreateLayerTags.tags">
        <short>A list of tags that specify the properties of the layer.</short>
      </element>
      <element name="ScaleLayerTags">
        <short>Scale a layer.</short>
        <descr>
          <p>Scale the given layer. This function will use the current shape of the layer and resize it according to the given newwidth/newheight.</p>
          <remark>? This function is introduced in AROS.?</remark>
          <table border="1">
            <th>
              <td>TagItem</td>
              <td/>
              <td>Description</td>
            </th>
            <tr>
              <td>LA_DESTWIDTH</td>
              <td>:</td>
              <td>Destination width of layer to scale</td>
            </tr>
            <tr>
              <td>LA_DESTHEIGHT</td>
              <td>:</td>
              <td>Destination height of layer to scale</td>
            </tr>
          </table>
        </descr>
      </element>
      <element name="ScaleLayerTags.Result">
        <descr>
          <p>Returns a boolean state which establishes whether the layer was scaled.
</p>
          <p>
            <link id="Exec.LTrue">LTrue</link> - everything went alright.
            <br/>
            <link id="Exec.LFalse">LFalse</link> - otherwise.
</p>
        </descr>
      </element>
      <element name="ScaleLayerTags.l">
        <short>Pointer to layer.</short>
      </element>
      <element name="ScaleLayerTags.tags">
        <short>A list of tags.</short>
        <descr>
          <p>Possible tagitems are:<br/>
newwidth    - new width of the layer<br/>
newheight   - new height of the layer<br/>
          </p>
        </descr>
      </element>
      <short>AROS' implementation of the hyperlayers library.</short>
      <descr>
        <p>The layers library takes care of housekeeping: the low level, repetitive tasks which are required to keep track of where to place bits. The layers library also provides a locking mechanism which coordinates display updating when multiple tasks are drawing graphics to layers. The windowing environment provided by the Intuition library is largely based on layers.</p>
        <p>ToDo:</p>
        <ul>
          <li>fix: parent layer should get/use layer info hook-handling of errors: out of memory error.</li>
          <li>optimization: if a layer is already completely hidden there is no need to call _BackupPartsOfLayer() again.</li>
          <li>optimization: do not copy a bitmap that has the same size and offset as the target bitmap but rather move only the pointer (if possible).</li>
        </ul>
      </descr>
      <notes>
        <note>Please remove Editorial Note:</note>
        <note>A Struct ScaleLayerParam is present in scalelayer.h, as well as a defined hook for ScaleLayerCallback. Both seems unused.</note>
        <note>Specific tags for using taglist does not seem to be documented.</note>
      </notes>
    </module>
    <short>Surprisingly this is the RTL of AROS</short>
  </package>
</fpdoc-descriptions>