Unit 'layers' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#aros]

InstallLayerHook

safely install a new TLayer.BackFill hook

Declaration

Source position: layers.pas line 127

function InstallLayerHook(

  Layer: PLayer;

  Hook: PHook

):PHook;

Arguments

Layer

  

pointer to the layer in which to install the Backfill Hook.

Hook

  

pointer to layer callback Hook which will be called

Function result

pointer to the TLayer.BackFill Hook that was previously active. Returns nil if it was the default hook. In V39, it could return 1 if there was no hook.

Description

Installs a new TLayer.BackFill Hook, waiting until it is safe to do so. Locks the layer while substituting the new Hook and removing the old one. If a new Hook is not provided, will install the default layer BackFill Hook.

Hook will be called with:

object = PRastPort(Result^.RastPort);
message = [ layer: PLayer, bounds: TRectangle, offsetx: LongInt, offsety: LongInt;]

This hook should fill the Rectangle in the RastPort with the BackFill pattern appropriate for offset x/y.

If hook is LAYERS_BACKFILL, the default backfill is used for the layer.

If hook is LAYERS_NOBACKFILL, the layer will not be backfilled (NO-OP).

Attention

The RastPort you are passed back is the same one passed to the function. You should not use "layered" rendering functions on this RastPort. Generally, you will wish to do BitMap operations such as BltBitMap(). The callback is a raw, low-level rendering call-back. If you need to call a rendering operation with a RastPort, make sure you use a copy of the RastPort and nil the Layer pointer.


Documentation generated on: 2021-07-30