BehindLayer()
Synopsis
LONG BehindLayer(
LONG dummy,
struct Layer * l );
Function
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.
The areas of simple layers, that become visible by moving this
layer, are added to the damagelist and the LAYERREFRESH flag
is set.
Result
TRUE - layer was successfully moved
FALSE - layer could not be moved (probably out of memory)
ChangeLayerShape()
Synopsis
struct Region * ChangeLayerShape(
struct Layer * l,
struct Region * newshape,
struct Hook * callback );
Function
Changes the shape of the layer on the fly.
When the shape of a layer is changed the current pixel content
is copied into its ClipRects so no information is lost.
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:
AROS_UFC3(BOOL, callback,
AROS_UFCA(struct Hook * , hook , A0),
AROS_UFCA(struct Layer * , l , A2),
AROS_UFCA(struct ShapeHookMsg * , arg , A1));
Result
Pointer to the previously installed region.
ChangeLayerVisibility()
Synopsis
LONG ChangeLayerVisibility(
struct Layer * l,
int visible );
Function
Makes the given layer visible or invisible.
If it is a simple refresh layer it will loose all its
cliprects and therefore rendering will go into the void.
Result
TRUE - layer was changed to new state
FALSE - layer could not be changed to new state
Notes
This is an AROS private function, providing support
for showing/hiding windows in intuition.
CollectPixelsLayer()
Synopsis
void CollectPixelsLayer(
struct Layer * l,
struct Region * r,
struct Hook * callback );
Function
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...
CreateBehindHookLayer()
Synopsis
struct Layer * CreateBehindHookLayer(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct Hook * hook,
struct BitMap * bm2 );
Function
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.
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.
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.
Result
Pointer to the newly created layer. NULL if layer could not be
created (Probably out of memory).
Notes
Does not allow to create layers that are partially outside
the given bitmap (, yet).
CreateBehindLayer()
Synopsis
struct Layer * CreateBehindLayer(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct BitMap * bm2 );
CreateBehindLayerTagList()
Synopsis
struct Layer * CreateBehindLayerTagList(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct TagItem * tagList );
struct Layer * CreateBehindLayerTags(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
TAG tag, ... );
Function
Create a new layer according to the tags given.
Result
Pointer to the newly created layer. NULL if layer could not be
created (Probably out of memory).
If the layer is created successfully you must not free its shape.
The shape is automatically freed when the layer is deleted.
CreateUpfrontHookLayer()
Synopsis
struct Layer * CreateUpfrontHookLayer(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct Hook * hook,
struct BitMap * bm2 );
Function
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.
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.
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.
Result
pointer to layer if successful, NULL otherwise
Notes
Does not allow to create layers that are partially outside
the given bitmap (, yet).
CreateUpfrontLayer()
Synopsis
struct Layer * CreateUpfrontLayer(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct BitMap * bm2 );
CreateUpfrontLayerTagList()
Synopsis
struct Layer * CreateUpfrontLayerTagList(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
struct TagItem * tagList );
struct Layer * CreateUpfrontLayerTags(
struct Layer_Info * li,
struct BitMap * bm,
LONG x0,
LONG y0,
LONG x1,
LONG y1,
LONG flags,
TAG tag, ... );
Function
Create a new layer according to the tags given.
Result
Pointer to the newly created layer. NULL if layer could not be
created (Probably out of memory).
If the layer is created successfully you must not free its shape.
The shape is automatically freed when the layer is deleted.
DeleteLayer()
Synopsis
LONG DeleteLayer(
LONG dummy,
struct Layer * l );
Function
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.
Result
TRUE - layer was successfully deleted
FALSE - layer could not be delete (out of memory)
EndUpdate()
Synopsis
void EndUpdate(
struct Layer * l,
UWORD flag );
Function
After the damaged areas are updated, this routine should be
called so the regular cliprects of the layer can be installed.
InitLayers()
Synopsis
void InitLayers(
struct Layer_Info * li );
Function
Initializes the supplied Layer_Info, so it's ready for use.
Leaves the Layer_Info in an unlocked state.
Notes
This function is obsolete. Use NewLayerInfo() instead.
InstallClipRegion()
Synopsis
struct Region * InstallClipRegion(
struct Layer * l,
struct Region * region );
Function
Install a transparent Clip region in the layer. All subsequent
graphics call to the rastport of the layer will be clipped to
that region.
None of the system functions will free the ClipRegion for you,
so you will have to call InstallClipRegion(l, NULL) before
closing a window or deleting a layer.
InstallLayerHook()
Synopsis
struct Hook * InstallLayerHook(
struct Layer * layer,
struct Hook * hook );
Function
Safely install a new backfill hook. Return the old hook.
If hook is NULL, then the default backfill hook will be installed.
InstallLayerInfoHook()
Synopsis
struct Hook * InstallLayerInfoHook(
struct Layer_Info * li,
struct Hook * hook );
Function
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.
Result
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.
Notes
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.
IsLayerHiddenBySibling()
Synopsis
BOOL IsLayerHiddenBySibling(
struct Layer * l,
BOOL check_invisible );
Function
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.
It can be specified whether invisible siblings are to be
considered in the comparison.
Result
TRUE - layer is hidden by one or more siblings
FALSE - layer is fully visible
IsLayerHitAt()
Synopsis
BOOL IsLayerHitAt(
struct Layer * l,
LONG x,
LONG y );
Function
Tells whether the point (x,y), in the coordinates of the layer's
bitmap (screen coordinates), hits the layer: the layer is visible,
the point is inside its shape and, for a composited layer with a
per pixel alpha surface (LA_Composited + LA_AlphaSurface), the
surface pixel there is not fully transparent (alpha 0).
A layer with an input shape (LA_InputShape,
ChangeLayerInputShape()) is hit where the point is inside both
its visible shape and its input shape; alpha does not count then.
This is the policy WhichLayer() applies to every layer front to
back; it lets Intuition and applications apply the same one, for
example to decide whether a click on a shaped, translucent window
belongs to it or to what is seen through its transparent parts.
Result
TRUE when the point hits the layer, FALSE when it does not.
Layers in front of l are not taken into account: a point inside l
that is covered by another layer still hits l. Use WhichLayer()
to find the frontmost layer at a point.
Notes
The function does not lock the Layer_Info. It is the
responsibility of the caller to hold the lock (LockLayerInfo() /
UnlockLayerInfo()) as for WhichLayer().
A composited layer with a constant opacity (LA_Opacity) but
without an alpha surface is hit everywhere inside its shape, as
are all other layer kinds, whatever is drawn in them.
This function is an AROS extension. It is not MorphOS's
IsLayerHitable(layer), which takes the layer only, answers a
different question (is the layer hitable at all) and has its own,
earlier LVO, which stays reserved for it.
MoveLayer()
Synopsis
LONG MoveLayer(
LONG dummy,
struct Layer * l,
LONG dx,
LONG dy );
Function
Move the layer to a specified position in the bitmap.
Parts of simple layers that become visible are added to
the damage list and a refresh is triggered.
Result
result - TRUE everyting went alright
FALSE an error occurred (out of memory)
MoveLayerInFrontOf()
Synopsis
LONG MoveLayerInFrontOf(
struct Layer * layer_to_move,
struct Layer * other_layer );
Function
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.
If parts of a simple layer become visible these areas are added
to the damage list.
Result
TRUE - layer was moved
FALSE - layer could not be moved. (probably out of memory)
MoveSizeLayer()
Synopsis
LONG MoveSizeLayer(
struct Layer * l,
LONG dx,
LONG dy,
LONG dw,
LONG dh );
Function
Moves and resizes the layer in one step. Collects damage lists
for those layers that become visible and are simple layers.
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.
Result
result - TRUE if everything went right
FALSE if an error occurred (out of memory)
ScaleLayer()
Synopsis
ULONG ScaleLayer(
struct Layer * l,
struct TagItem * taglist );
ULONG ScaleLayerTags(
struct Layer * l,
TAG tag, ... );
Function
Scale the pixel content of the given layer. The layer's bounds and
shape are left alone; the source rectangle of the layer's content
is scaled into the destination rectangle and the result becomes the
new content of the layer. Areas of the layer not covered by the
destination rectangle are cleared.
Result
TRUE if the content was scaled, FALSE otherwise.
Notes
Only smart refresh layers can be scaled: simple refresh layers keep
no copy of their pixels, and superbitmap layers own their pixels
in the caller's bitmap.
SizeLayer()
Synopsis
LONG SizeLayer(
LONG dummy,
struct Layer * l,
LONG dw,
LONG dh );
Function
Resizes the given layer by adding dw to its width and dh
to its height.
If parts of simple layers become visible those parts are
added to the damage list and a refresh is triggered for
those layers.
If the new layer is bigger than before the additional parts
are added to a damage list if the layer is a non-super-
bitmap layer. Refresh is also triggered for this layer.
Result
TRUE - layer could be resized
FALSE - error occurred (out of memory)
SortLayerCR()
Synopsis
void SortLayerCR(
struct Layer * layer,
LONG dx,
LONG dy );
Function
Sorts the list of ClipRects associated with the given layer.
The direction of the sort is indicated by dx and dy.
Result
The layer->ClipRect pointer now points to a sorted list of ClipRects.
UpfrontLayer()
Synopsis
LONG UpfrontLayer(
LONG dummy,
struct Layer * l );
Function
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.
Parts of a simple layer that become visible are added to the
damage list and the REFRESH flag is set.
Result
TRUE - layer was moved
FALSE - layer could not be moved (probably out of memory)
WhichLayer()
Synopsis
struct Layer * WhichLayer(
struct Layer_Info * li,
LONG x,
LONG y );
Function
Determines in which layer the point (x,y) is to be found.
Starts with the frontmost layer.
Notes
The function does not lock Layer_Info structure. It is
the responsibility of the caller to issue the lock via
LockLayerInfo()/UnlockLayerInfo()
AROS: a composited layer with a per pixel alpha surface
(LA_AlphaSurface) is not hit where its surface pixel is fully
transparent; the layer behind it is returned there. See
IsLayerHitAt().