2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <exec/lists.h>
10 #include <exec/memory.h>
11 #include <proto/exec.h>
12 #include <proto/alib.h>
13 #include <proto/arossupport.h>
14 #ifndef INTUITION_CLASSES_H
15 # include <intuition/classes.h>
17 #ifndef UTILITY_HOOKS_H
18 # include <utility/hooks.h>
20 #include <utility/utility.h>
21 #include <aros/asmcall.h>
24 AROS_UFP3S(ULONG
, rootDispatcher
,
25 AROS_UFPA(Class
*, cl
, A0
),
26 AROS_UFPA(Object
*, obj
, A2
),
27 AROS_UFPA(Msg
, msg
, A1
)
32 { { NULL
, NULL
}, rootDispatcher
, NULL
, NULL
},
34 NULL
, /* No superclass */
35 (ClassID
)ROOTCLASS
, /* ClassID */
37 0, 0, /* No offset and size */
40 0, /* SubClassCount */
46 #define BOOPSIBase (GetBBase(cl->cl_UserData))
48 /*****i************************************************************************
51 AROS_UFH3S(IPTR
, rootDispatcher
,
54 AROS_UFHA(Class
*, cl
, A0
),
55 AROS_UFHA(Object
*, o
, A2
),
56 AROS_UFHA(Msg
, msg
, A1
))
61 Processes all messages sent to the RootClass. Unknown messages are
65 cl - Pointer to the RootClass
66 o - This object was the destination for the message in the first
68 msg - This is the message.
71 Processes the message. The meaning of the result depends on the
75 This is a good place to debug BOOPSI objects since every message
76 should eventually show up here.
87 ******************************************************************************/
93 switch (msg
->MethodID
)
98 /* Get memory. The objects shows how much is needed.
99 (The object is not an object, it is a class pointer!) */
100 o
= (Object
*) AllocVec (objcl
->cl_InstOffset
102 + sizeof (struct _Object
)
103 , MEMF_ANY
|MEMF_CLEAR
106 ((struct _Object
*)o
)->o_Class
= objcl
;
107 retval
= (IPTR
) BASEOBJECT(o
);
111 /* Free memory. Caller is responsible that everything else
112 is already cleared! */
113 FreeVec (_OBJECT(o
));
117 /* Add <o> to list. */
118 AddTail (((struct opAddTail
*)msg
)->opat_List
,
119 (struct Node
*) _OBJECT(o
));
123 /* Remove object from list. */
124 Remove ((struct Node
*) _OBJECT(o
));
141 } /* rootDispatcher */