Docs » Autodocs » layers.library » InstallLayerInfoHook
InstallLayerInfoHook - Install a backfill hook for non-layer (V39)
oldhook=InstallLayerInfoHook(li,hook) d0 a0 a1 struct Hook *InstallLayerInfoHook(struct Layer_Info *,struct Hook *);
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.
li - pointer to LayerInfo structure hook - pointer to layer callback Hook which will be called with object == (struct RastPort *) result->RastPort and message == [ (ULONG) undefined, (struct Rectangle) bounds ] This hook should fill the Rectangle in the RastPort with the BackFill pattern appropriate for rectangle given. If hook is LAYERS_BACKFILL, the default backfill is used. (Same as pre-2.0) If hook is LAYERS_NOBACKFILL, there will be no backfill. (NO-OP).
oldhook - 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.
See the example in InstallLayerHook. Note that both the Layer pointer and the OffsetX/Y values are not available in the LayerInfo backfill hook.
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 NULL the Layer pointer.
InstallLayerHook()
|