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

InstallLayerInfoHook

Install a backfill hook for non-layer

Declaration

Source position: layers.pas line 184

function InstallLayerInfoHook(

  Li: PLayer_Info;

  const Hook: PHook

):PHook;

Arguments

Li

  

pointer to LayerInfo structure

Hook

  

pointer to layer callback Hook which will be called

Function result

Returns the backfill hook that was in the Layer_Info. Returns LAYERS_BACKFILL if the default was installed. Returns LAYERS_NOBACKFILL if there was a NO-OP hook. Returns -1 if there was some failure.

Description

This function will install a backfill hook for the Layer_Info structure passed. This backfill hook will be used to clear the background area where no layer exists. The hook function is passed the RastPort and the bounds just like the layer backfill hook. Note that this hook could be called for any layer.

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

When the hook is first installed, it is not called. It is up to the application to know if it is safe to fill in the area. Since the hook will be called when a layer is deleted, the easiest way to have layers call this hook is to create and delete a backdrop layer that is the size of the area.

Also, note that currently the first long word of the hook message contains an undefined value. This value may look like a layer pointer. It is not a layer pointer.

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