2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: layers.library Resident and initialization.
9 #include <exec/types.h>
10 #include <exec/resident.h>
11 #include <graphics/gfxbase.h>
12 #include <proto/exec.h>
14 #include "layers_extfuncs.h"
16 #include <graphics/clip.h>
17 #include <graphics/regions.h>
18 #include <graphics/layers.h>
19 #include <aros/asmcall.h>
22 #include <aros/debug.h>
25 extern const UBYTE Layers_name
[];
26 extern const UBYTE Layers_version
[];
27 extern UBYTE Layers_dearray
[];
28 int Layers_start(void);
30 extern const char END
;
32 int Layers_entry(void)
34 /* If the library was executed by accident return error code. */
38 struct SpecialResident
46 #define SR_COOKIE 0x4afa4afb
48 const struct SpecialResident Layers_resident
=
52 (struct Resident
*)&Layers_resident
,
57 63, /* priority; just after layers.library */
59 (STRPTR
)&Layers_version
[6],
62 SR_COOKIE
, /* magic cookie to recognize a patchable library */
63 Layers_dearray
, /* pointer to array of function status bytes */
64 36 /* highest vector slot in this library */
67 UBYTE Layers_dearray
[] =
69 /* 36 functions in layers.library V40 (plus one for offset 0) */
70 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0- 9 */
71 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10- 19 */
72 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20- 29 */
73 1, 1, 1, 1, 1, 1, 1 /* 30- 39 */
76 const UBYTE Layers_name
[]="layers.strap";
78 const UBYTE Layers_version
[]="$VER: layers.strap 41.2 (02.11.1997)";
80 #define SetFunc(offset,name) \
82 if(Layers_dearray[offset]) \
83 SetFunction((struct Library *)LayersBase, (offset * -6), (APTR)&AROS_SLIB_ENTRY(name,Layers)); \
86 /* use this to disable a setfunc that doesn't work yet */
87 #define SetFunc0(offset,name) /* eps */
89 /* use this to disable a setfunc that works (to keep the 2 types apart), so
90 * the malfunctioning function can be isolated
91 * If this doesn't make sense, don't worry. :-)
93 #define SetFunc1(offset,name) /* eps */
95 int Layers_start(void)
97 struct Library
*LayersBase
;
98 struct Library
*SysBase
= *(void **)4;
100 D(bug("\nlayers.strap installing...\n"));
103 if( (LayersBase
= OpenLibrary("layers.library", 37)))
106 * fc = functions correctly (according to observations or test program)
107 * ni = not implemented
109 SetFunc1( 5, InitLayers
); // fc
110 SetFunc1( 6, CreateUpfrontLayer
); // fc
111 SetFunc1( 7, CreateBehindLayer
); // fc
112 SetFunc0( 8, UpfrontLayer
); // ni
113 SetFunc0( 9, BehindLayer
); // ni
114 SetFunc1(10, MoveLayer
); // fc
115 SetFunc1(11, SizeLayer
); // fc
116 SetFunc0(12, ScrollLayer
); // ni
117 SetFunc0(13, BeginUpdate
); // ni
118 SetFunc0(14, EndUpdate
); // ni
119 SetFunc0(15, DeleteLayer
); // ni
120 SetFunc1(16, LockLayer
); // fc
121 SetFunc1(17, UnlockLayer
); // fc
122 SetFunc0(18, LockLayers
); // ni
123 SetFunc0(19, UnlockLayers
); // ni
124 SetFunc1(20, LockLayerInfo
); // fc
125 SetFunc1(21, SwapBitsRastPortClipRect
); // fc
126 SetFunc1(22, WhichLayer
); // fc
127 SetFunc1(23, UnlockLayerInfo
); // fc
128 SetFunc1(24, NewLayerInfo
); // fc
129 SetFunc1(25, DisposeLayerInfo
); // fc
130 SetFunc1(26, FattenLayerInfo
); // fc
131 SetFunc1(27, ThinLayerInfo
); // fc
132 SetFunc0(28, MoveLayerInFrontOf
); // ni
133 SetFunc0(29, InstallClipRegion
); // ni
134 SetFunc0(30, MoveSizeLayer
); // ni
135 SetFunc1(31, CreateUpfrontHookLayer
); // fc
136 SetFunc0(32, CreateBehindHookLayer
); // ni
137 SetFunc1(33, InstallLayerHook
); // fc
138 SetFunc1(34, InstallLayerInfoHook
); // fc
139 SetFunc1(35, SortLayerCR
); // fc
140 SetFunc1(36, DoHookClipRects
); // fc
143 * General note about these functions: superbitmap handling is untested!
146 CloseLibrary(LayersBase
);
152 D(void patchlist(void)
156 for(i
= 1; i
< Layers_resident
.maxslot
; i
++)
157 kprintf(Layers_dearray
[i
] ? "+" : "-");