revert between 56095 -> 55830 in arch
[AROS.git] / compiler / include / graphics / clip.h
blobdbbb3b6a22cf033d8f63a6df1623c607fbc520ee
1 #ifndef GRAPHICS_CLIP_H
2 #define GRAPHICS_CLIP_H
4 /*
5 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Clip descriptions.
9 Lang: english
12 #ifndef EXEC_SEMAPHORES_H
13 # include <exec/semaphores.h>
14 #endif
15 #ifndef EXEC_TYPES_H
16 # include <exec/types.h>
17 #endif
18 #ifndef GRAPHICS_GFX_H
19 # include <graphics/gfx.h>
20 #endif
21 #ifndef INTUITION_INTUITION_H
22 # include <intuition/intuition.h>
23 #endif
25 #ifndef UTILITY_HOOKS_H
26 # include <utility/hooks.h>
27 #endif
29 #define NEWLOCKS
32 struct Layer
34 struct Layer * front;
35 struct Layer * back;
36 struct ClipRect * ClipRect;
37 struct RastPort * rp;
38 struct Rectangle bounds;
40 #if 1
41 struct Layer * parent; /* PRIVATE !!! */
42 #else
43 UBYTE reserved[4];
44 #endif
45 UWORD priority;
46 UWORD Flags;
48 struct BitMap * SuperBitMap;
49 struct ClipRect * SuperClipRect;
51 APTR Window;
52 WORD Scroll_X;
53 WORD Scroll_Y;
55 struct ClipRect * cr;
56 struct ClipRect * cr2;
57 struct ClipRect * crnew;
58 struct ClipRect * SuperSaveClipRects;
59 struct ClipRect * _cliprects;
61 struct Layer_Info * LayerInfo;
62 struct SignalSemaphore Lock;
63 struct Hook * BackFill;
65 #if 1
66 struct Region * VisibleRegion; /* PRIVATE !!! */
67 #else
68 ULONG reserved1;
69 #endif
71 struct Region * ClipRegion;
72 struct Region * saveClipRects;
74 WORD Width;
75 WORD Height;
77 #if 1
78 struct Region * shape; /* PRIVATE !!! */
79 struct Region * shaperegion; /* PRIVATE !!! */
80 struct Region * visibleshape; /* PRIVATE !!! */
82 UWORD nesting; /* PRIVATE !!! */
83 UBYTE SuperSaveClipRectCounter; /* PRIVATE !!! */
84 UBYTE visible; /* PRIVATE !!! */
86 UBYTE reserved2[2];
87 #else
88 UBYTE reserved2[18];
89 #endif
91 struct Region * DamageList;
94 #define MAXSUPERSAVECLIPRECTS 20 /* Max. number of cliprects that are kept preallocated in the list */
96 struct ClipRect
98 struct ClipRect * Next;
99 struct ClipRect * prev;
100 struct Layer * lobs;
101 struct BitMap * BitMap;
102 struct Rectangle bounds;
104 void * _p1;
105 void * _p2;
106 LONG reserved;
107 LONG Flags;
110 /* PRIVATE */
111 #define CR_NEEDS_NO_CONCEALED_RASTERS 1
112 #define CR_NEEDS_NO_LAYERBLIT_DAMAGE 2
114 #define ISLESSX (1<<0)
115 #define ISLESSY (1<<1)
116 #define ISGRTRX (1<<2)
117 #define ISGRTRY (1<<3)
119 /* This one is used for determining optimal offset for blitting into
120 cliprects */
121 #define ALIGN_CLIPRECT 16
122 #define ALIGN_OFFSET(x) ((x) & (ALIGN_CLIPRECT-1))
126 * Tags for scale layer
128 #define LA_SRCX 0x4000
129 #define LA_SRCY 0x4001
130 #define LA_DESTX 0x4002
131 #define LA_DESTY 0x4003
132 #define LA_SRCWIDTH 0x4004
133 #define LA_SRCHEIGHT 0x4005
134 #define LA_DESTWIDTH 0x4006
135 #define LA_DESTHEIGHT 0x4007
137 #define IS_VISIBLE(l) (TRUE == l->visible)
139 struct ChangeLayerShapeMsg
141 struct Region * newshape; // same as passed to ChangeLayerShape()
142 struct ClipRect * cliprect;
143 struct Region * shape;
146 struct CollectPixelsLayerMsg
148 LONG xSrc;
149 LONG ySrc;
150 LONG width;
151 LONG height;
152 LONG xDest;
153 LONG yDest;
154 struct BitMap * bm;
155 struct Layer * layer;
156 ULONG minterm;
160 AmigaOS4-style shape hook.
162 Msg sent through LA_ShapeHook. Hook function must look like this:
164 AROS_UFH3(BOOL, MyShapeFunc,
165 AROS_UFHA(struct Hook *, hook, A0),
166 AROS_UFHA(struct Layer *, layer, A2),
167 AROS_UFHA(struct ShapeHookMsg *, msg, A1))
171 #define SHAPEHOOKACTION_CREATELAYER 0
172 #define SHAPEHOOKACTION_MOVELAYER 1
173 #define SHAPEHOOKACTION_SIZELAYER 2
174 #define SHAPEHOOKACTION_MOVESIZELAYER 3
175 #define SHAPEHOOKACTION_CHANGELAYERSHAPE 4
177 struct ShapeHookMsg
179 LONG Action;
180 struct Region *NewShape;
181 struct Region *OldShape;
182 struct Rectangle *NewBounds;
183 struct Rectangle *OldBounds;
186 #endif /* GRAPHICS_CLIP_H */