2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Basic support functions for layers.library.
9 #include "layers_intern.h"
10 #include <exec/types.h>
11 #include <graphics/gfx.h>
12 #include <graphics/clip.h>
28 /***************************************************************************/
30 /***************************************************************************/
32 void BltRPtoCR(struct RastPort
* rp
,
35 struct LayersBase
* LayersBase
);
37 void BltCRtoRP(struct RastPort
* rp
,
40 struct LayersBase
* LayersBase
);
42 /***************************************************************************/
44 /***************************************************************************/
46 void _CallLayerHook(struct Hook
* h
,
52 struct LayersBase
* LayersBase
);
55 /***************************************************************************/
57 /***************************************************************************/
59 void SetLayerPriorities(struct Layer_Info
* li
);
60 struct Layer
* internal_WhichLayer(struct Layer
* l
, WORD x
, WORD y
);
61 void _FreeLayer(struct Layer
* l
, struct LayersBase
*LayersBase
);
63 /***************************************************************************/
65 /***************************************************************************/
67 BOOL _AllocExtLayerInfo
68 (struct Layer_Info
* li
, struct LayersBase
*LayersBase
);
70 void _FreeExtLayerInfo
71 (struct Layer_Info
* li
, struct LayersBase
*LayersBase
);
74 (struct Layer_Info
* li
, struct LayersBase
* LayersBase
);
77 (struct Layer_Info
* li
, struct LayersBase
* LayersBase
);
80 (struct Layer_Info
* li
, struct LayersBase
* LayersBase
);
83 (struct Layer_Info
* li
, struct LayersBase
* LayersBase
);
85 /***************************************************************************/
87 /***************************************************************************/
89 //void _TranslateRect(struct Rectangle *rect, WORD dx, WORD dy);
90 struct ClipRect
* internal_WhichClipRect(struct Layer
* L
, WORD x
, WORD y
);
93 /***************************************************************************/
94 /* RESOURCE HANDLING */
95 /***************************************************************************/
97 BOOL
AddLayersResource(struct Layer_Info
* li
,
101 struct ResourceNode
* AddLayersResourceNode(struct Layer_Info
* li
);
103 struct ClipRect
* _AllocClipRect(struct Layer
* L
, struct LayersBase
*LayersBase
);
104 void _FreeClipRect(struct ClipRect
* CR
, struct Layer
* L
, struct LayersBase
*LayersBase
);
105 void _FreeClipRectListBM(struct Layer
* L
, struct ClipRect
* CR
, struct LayersBase
*LayersBase
);
107 void FreeCRBitMap(struct ClipRect
* cr
);
109 void * AllocLayerStruct(ULONG Size
,
111 struct Layer_Info
* li
,
112 struct LayersBase
* LayersBase
);
114 void FreeLayerResources(struct Layer_Info
* li
,
117 /***************************************************************************/
119 /***************************************************************************/
121 void CleanTopLayer(struct Layer_Info
* LI
);
122 void CleanupLayers(struct Layer_Info
* LI
);
123 void UnsplitLayers(struct Layer_Info
* LI
, struct Rectangle
* rect
);
124 void CopyAndFreeClipRectsClipRects(struct Layer
* L
,
125 struct ClipRect
* srcCR
,
126 struct ClipRect
* destCR
);
127 int _CopyClipRectsToClipRects(struct Layer
* l
,
128 struct ClipRect
* oldcr
,
129 struct ClipRect
* newcr
,
135 struct LayersBase
*LayersBase
);
136 void UninstallClipRegionClipRects(struct Layer_Info
* LI
);
137 void InstallClipRegionClipRects(struct Layer_Info
* LI
);
139 /*-----------------------------------END-----------------------------------*/
141 #define RECTAREA(r) (((r)->MaxX - (r)->MinX + 1) * ((r)->MaxY - (r)->MinY + 1))
143 #define DO_OVERLAP(r1,r2) (!( ((r1)->MinX > (r2)->MaxX) || \
144 ((r1)->MinY > (r2)->MaxY) || \
145 ((r1)->MaxX < (r2)->MinX) || \
146 ((r1)->MaxY < (r2)->MinY) ))
148 #define IS_EMPTYREGION(r) (NULL == (r)->RegionRectangle)
150 #define IS_ROOTLAYER(l) ((l) == (l)->LayerInfo->check_lp)
152 #define CHECKDAMAGELIST(l) \
153 if (IS_EMPTYREGION(l->DamageList)) \
155 l->Flags &= ~LAYERREFRESH; \
158 l->Flags |= LAYERREFRESH;
160 int _BackupPartsOfLayer(struct Layer
* l
,
161 struct Region
* hide_region
,
163 int backupsimplerefresh
,
164 struct LayersBase
*);
166 int _ShowPartsOfLayer(struct Layer
* l
,
167 struct Region
* show_region
,
168 struct LayersBase
*);
170 int _ShowLayer(struct Layer
* l
, struct LayersBase
*LayersBase
);
172 struct Layer
* _FindFirstFamilyMember(struct Layer
* l
);
174 void _BackFillRegion(struct Layer
* l
,
177 struct LayersBase
* LayersBase
);
179 struct ClipRect
* _CreateClipRectsFromRegion(struct Region
*r
,
182 struct Region
*inverter
,
183 struct LayersBase
*LayersBase
);
185 struct Region
*_InternalInstallClipRegion(struct Layer
*l
, struct Region
*region
,
186 WORD srcdx
, WORD destdx
,
187 struct LayersBase
*LayersBase
);