2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <aros/asmcall.h>
8 #include <aros/atomic.h>
9 #include <exec/lists.h>
10 #include <exec/memory.h>
11 #include <proto/exec.h>
12 #include <proto/alib.h>
13 #include <intuition/classes.h>
14 #include <utility/hooks.h>
15 #include <utility/utility.h>
16 #include "intuition_intern.h"
18 #define IntuitionBase (GetPrivIBase(cl->cl_UserData))
20 #define ENABLE_MEM_POOL 1
23 # define alloc(a, b) AllocPooled(a, b)
24 # define free(a, b, c) FreePooled(a, b, c)
26 # define alloc(a, b) AllocMem(b, MEMF_PUBLIC|MEMF_CLEAR)
27 # define free(a, b, c) FreeMem(b, c)
31 /*****i************************************************************************
34 AROS_UFH3(IPTR
, rootDispatcher
,
37 AROS_UFHA(Class
*, cl
, A0
),
38 AROS_UFHA(Object
*, o
, A2
),
39 AROS_UFHA(Msg
, msg
, A1
))
44 Processes all messages sent to the RootClass. Unknown messages are
48 cl - Pointer to the RootClass
49 o - This object was the destination for the message in the first
51 msg - This is the message.
54 Processes the message. The meaning of the result depends on the
58 This is a good place to debug BOOPSI objects since every message
59 should eventually show up here.
67 ******************************************************************************/
74 switch (msg
->MethodID
)
80 Get memory for the instance data. The class knows how much is
81 needed. NOTE: The object argument is actually the class!
86 iclass
->cl_MemoryPool
, iclass
->cl_ObjectSize
91 _OBJ(o
)->o_Class
= iclass
;
93 AROS_ATOMIC_INC(iclass
->cl_ObjectCount
);
95 retval
= (IPTR
) BASEOBJECT(o
);
101 Free memory. Caller is responsible that everything else
108 iclass
->cl_MemoryPool
, _OBJECT(o
), iclass
->cl_ObjectSize
111 AROS_ATOMIC_DEC(iclass
->cl_ObjectCount
);
115 /* Add <o> to list. */
116 AddTail (((struct opAddTail
*)msg
)->opat_List
, (struct Node
*) _OBJECT(o
));
121 /* Remove object from list. */
122 Remove ((struct Node
*) _OBJECT(o
));
143 } /* rootDispatcher */