added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / graphics / clip.h
blob624b85f23063a91617894e0409eed2c204323c9e
1 #ifndef GRAPHICS_CLIP_H
2 #define GRAPHICS_CLIP_H
4 /*
5 Copyright © 1995-2001, 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_OFFSET(x) ((x) & 0x0F)
124 #define LA_Priority WA_Priority
125 #define LA_Hook WA_BackFill
126 #define LA_SuperBitMap WA_SuperBitMap
127 #define LA_ChildOf WA_Parent
128 #define LA_InFrontOf WA_InFrontOf
129 #define LA_Behind WA_Behind
130 #define LA_Visible WA_Visible
131 #define LA_Shape WA_Shape
132 #define LA_ShapeHook WA_ShapeHook
136 * Tags for scale layer
138 #define LA_SRCX 0x4000
139 #define LA_SRCY 0x4001
140 #define LA_DESTX 0x4002
141 #define LA_DESTY 0x4003
142 #define LA_SRCWIDTH 0x4004
143 #define LA_SRCHEIGHT 0x4005
144 #define LA_DESTWIDTH 0x4006
145 #define LA_DESTHEIGHT 0x4007
148 #define ROOTPRIORITY 0
149 #define BACKDROPPRIORITY 10
150 #define UPFRONTPRIORITY 20
152 #define IS_VISIBLE(l) (TRUE == l->visible)
154 struct ChangeLayerShapeMsg
156 struct Region * newshape; // same as passed to ChangeLayerShape()
157 struct ClipRect * cliprect;
158 struct Region * shape;
161 struct CollectPixelsLayerMsg
163 LONG xSrc;
164 LONG ySrc;
165 LONG width;
166 LONG height;
167 LONG xDest;
168 LONG yDest;
169 struct BitMap * bm;
170 struct Layer * layer;
171 ULONG minterm;
174 /* Msg sent through LA_ShapeHook. Hook function must look like this:
176 AROS_UFH3(struct Region *, MyShapeFunc,
177 AROS_UFHA(struct Hook *, hook, A0),
178 AROS_UFHA(struct Layer *, layer, A2),
179 AROS_UFHA(struct ShapeHookMsg *, msg, A1))
183 #define SHAPEHOOKACTION_CREATELAYER 0
184 #define SHAPEHOOKACTION_MOVELAYER 1
185 #define SHAPEHOOKACTION_SIZELAYER 2
186 #define SHAPEHOOKACTION_MOVESIZELAYER 3
188 struct ShapeHookMsg
190 LONG Action;
191 struct Layer *Layer;
192 struct Region *ActualShape;
193 struct Rectangle NewBounds;
194 struct Rectangle OldBounds;
197 #endif /* GRAPHICS_CLIP_H */