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 ENABLE_MEM_POOL 1
21 # define alloc(a, b) AllocPooled(a, b)
22 # define free(a, b, c) FreePooled(a, b, c)
24 # define alloc(a, b) AllocMem(b, MEMF_PUBLIC|MEMF_CLEAR)
25 # define free(a, b, c) FreeMem(b, c)
29 /*****i************************************************************************
32 AROS_UFH3(IPTR
, rootDispatcher
,
35 AROS_UFHA(Class
*, cl
, A0
),
36 AROS_UFHA(Object
*, o
, A2
),
37 AROS_UFHA(Msg
, msg
, A1
))
42 Processes all messages sent to the RootClass. Unknown messages are
46 cl - Pointer to the RootClass
47 o - This object was the destination for the message in the first
49 msg - This is the message.
52 Processes the message. The meaning of the result depends on the
56 This is a good place to debug BOOPSI objects since every message
57 should eventually show up here.
65 ******************************************************************************/
72 switch (msg
->MethodID
)
78 Get memory for the instance data. The class knows how much is
79 needed. NOTE: The object argument is actually the class!
84 iclass
->cl_MemoryPool
, iclass
->cl_ObjectSize
89 _OBJ(o
)->o_Class
= iclass
;
91 AROS_ATOMIC_INC(iclass
->cl_ObjectCount
);
93 retval
= (IPTR
) BASEOBJECT(o
);
99 Free memory. Caller is responsible that everything else
106 iclass
->cl_MemoryPool
, _OBJECT(o
), iclass
->cl_ObjectSize
109 AROS_ATOMIC_DEC(iclass
->cl_ObjectCount
);
113 /* Add <o> to list. */
114 AddTail (((struct opAddTail
*)msg
)->opat_List
, (struct Node
*) _OBJECT(o
));
119 /* Remove object from list. */
120 Remove ((struct Node
*) _OBJECT(o
));
141 } /* rootDispatcher */