revert between 56095 -> 55830 in arch
[AROS.git] / rom / hyperlayers / basicfuncs.h
blobce4f025ba4edc33ddbb71455aab016f0dd8289b1
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Basic support functions for layers.library.
6 Lang: English.
7 */
9 #include "layers_intern.h"
10 #include <exec/types.h>
11 #include <graphics/gfx.h>
12 #include <graphics/clip.h>
16 * Sections:
18 * + Blitter
19 * + Hook
20 * + Layer
21 * + LayerInfo
22 * + Rectangle
23 * + Resource Handling
24 * + Miscellaneous
28 /***************************************************************************/
29 /* BLITTER */
30 /***************************************************************************/
32 void BltRPtoCR(struct RastPort * rp,
33 struct ClipRect * cr,
34 ULONG Mode,
35 struct LayersBase * LayersBase);
37 void BltCRtoRP(struct RastPort * rp,
38 struct ClipRect * cr,
39 ULONG Mode,
40 struct LayersBase * LayersBase);
42 /***************************************************************************/
43 /* HOOK */
44 /***************************************************************************/
46 void _CallLayerHook(struct Hook * h,
47 struct RastPort * rp,
48 struct Layer * L,
49 struct Rectangle * R,
50 WORD offsetx,
51 WORD offsety,
52 struct LayersBase * LayersBase);
55 /***************************************************************************/
56 /* LAYER */
57 /***************************************************************************/
59 void SetLayerPriorities(struct Layer_Info * li);
60 struct Layer * internal_WhichLayer(struct Layer * l, WORD x, WORD y);
61 struct Layer *CreateLayerTagList(struct Layer_Info *li, struct BitMap *bm, LONG x0, LONG y0,
62 LONG x1, LONG y1, LONG flags, int priority, struct TagItem *tagList,
63 struct LayersBase *LayersBase);
64 void _FreeLayer(struct Layer * l, struct LayersBase *LayersBase);
65 struct Layer *GetFirstFamilyMember(struct Layer *l);
68 /***************************************************************************/
69 /* LAYERINFO */
70 /***************************************************************************/
72 BOOL _AllocExtLayerInfo
73 (struct Layer_Info * li, struct LayersBase *LayersBase);
75 void _FreeExtLayerInfo
76 (struct Layer_Info * li, struct LayersBase *LayersBase);
78 ULONG _InitLIExtra
79 (struct Layer_Info * li, struct LayersBase * LayersBase);
81 void _ExitLIExtra
82 (struct Layer_Info * li, struct LayersBase * LayersBase);
84 BOOL SafeAllocExtLI
85 (struct Layer_Info * li, struct LayersBase * LayersBase);
87 void SafeFreeExtLI
88 (struct Layer_Info * li, struct LayersBase * LayersBase);
90 /***************************************************************************/
91 /* RECTANGLE */
92 /***************************************************************************/
94 //void _TranslateRect(struct Rectangle *rect, WORD dx, WORD dy);
95 struct ClipRect * internal_WhichClipRect(struct Layer * L, WORD x, WORD y);
98 /***************************************************************************/
99 /* RESOURCE HANDLING */
100 /***************************************************************************/
102 BOOL AddLayersResource(struct Layer_Info * li,
103 void * ptr,
104 ULONG Size);
106 struct ResourceNode * AddLayersResourceNode(struct Layer_Info * li);
108 struct ClipRect * _AllocClipRect(struct Layer * L, struct LayersBase *LayersBase);
109 void _FreeClipRect(struct ClipRect * CR, struct Layer * L, struct LayersBase *LayersBase);
110 void _FreeClipRectListBM(struct Layer * L, struct ClipRect * CR, struct LayersBase *LayersBase);
112 void FreeCRBitMap(struct ClipRect * cr);
114 void * AllocLayerStruct(ULONG Size,
115 ULONG Flags,
116 struct Layer_Info * li,
117 struct LayersBase * LayersBase);
119 void FreeLayerResources(struct Layer_Info * li,
120 BOOL flag);
122 /***************************************************************************/
123 /* MISCELLANEOUS */
124 /***************************************************************************/
126 void CleanTopLayer(struct Layer_Info * LI);
127 void CleanupLayers(struct Layer_Info * LI);
128 void UnsplitLayers(struct Layer_Info * LI, struct Rectangle * rect );
129 void CopyAndFreeClipRectsClipRects(struct Layer * L,
130 struct ClipRect * srcCR,
131 struct ClipRect * destCR);
132 int _CopyClipRectsToClipRects(struct Layer * l,
133 struct ClipRect * oldcr,
134 struct ClipRect * newcr,
135 int srcdx,
136 int destdx,
137 int backupmode,
138 int freelist,
139 int addtodamagelist,
140 struct LayersBase *LayersBase);
141 void UninstallClipRegionClipRects(struct Layer_Info * LI);
142 void InstallClipRegionClipRects(struct Layer_Info * LI);
144 /***************************************************************************/
145 /* TRANSPARENCY HOOK */
146 /***************************************************************************/
148 struct Region *doCreateLayer(struct Hook *shapeHook, struct Region *layershape,
149 LONG x0, LONG y0, LONG x1, LONG y1,
150 APTR data, struct LayersBase *LayersBase);
151 void doChangeLayer(struct Layer *l, struct LayersBase *LayersBase);
153 /*-----------------------------------END-----------------------------------*/
155 #define RECTAREA(r) (((r)->MaxX - (r)->MinX + 1) * ((r)->MaxY - (r)->MinY + 1))
157 #define DO_OVERLAP(r1,r2) (!( ((r1)->MinX > (r2)->MaxX) || \
158 ((r1)->MinY > (r2)->MaxY) || \
159 ((r1)->MaxX < (r2)->MinX) || \
160 ((r1)->MaxY < (r2)->MinY) ))
162 #define IS_EMPTYREGION(r) (NULL == (r)->RegionRectangle)
164 #define IS_ROOTLAYER(l) ((l) == (l)->LayerInfo->check_lp)
166 int _BackupPartsOfLayer(struct Layer * l,
167 struct Region * hide_region,
168 int dx,
169 int backupsimplerefresh,
170 struct LayersBase *);
172 int _ShowPartsOfLayer(struct Layer * l,
173 struct Region * show_region,
174 struct LayersBase *);
176 int _ShowLayer(struct Layer * l, struct LayersBase *LayersBase);
178 struct Layer * _FindFirstFamilyMember(struct Layer * l);
180 void _BackFillRegion(struct Layer * l,
181 struct Region * r,
182 int addtodamagelist,
183 struct LayersBase * LayersBase);
185 struct ClipRect * _CreateClipRectsFromRegion(struct Region *r,
186 struct Layer * l,
187 int invisible,
188 struct Region *inverter,
189 struct LayersBase *LayersBase);
191 struct Region *_InternalInstallClipRegion(struct Layer *l, struct Region *region,
192 WORD srcdx, WORD destdx,
193 struct LayersBase *LayersBase);