more rendering corrections
[AROS.git] / workbench / libs / desktop / amiga_lib_functions.c
blobbb6130fa8aeaeb1ff04f4e45296380cf854c9c5f
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define NO_INLINE_STDARG /* turn off inline def */
8 #include <aros/asmcall.h>
10 #include <intuition/classusr.h>
11 #include <intuition/classes.h>
14 #include <proto/exec.h>
15 #include <proto/intuition.h>
16 #include <proto/muimaster.h>
18 #include <stdarg.h>
19 #include "alib_intern.h"
20 #include "desktop_intern.h"
22 #include <clib/alib_protos.h>
24 #define DEBUG 1
25 #include <aros/debug.h>
28 All of the functions here have been copied from amiga.lib. This means we
29 can convenient things like DoMethod() in desktop.library.
32 static ULONG dbgDoMethodCount = 0;
33 static ULONG dbgDoMethodNULLCount = 0;
35 IPTR DoMethodA(Object * obj, Msg message)
37 dbgDoMethodCount++;
38 D(bug("*** DoMethod count: %d\n", dbgDoMethodCount));
39 ASSERT_VALID_PTR(obj);
40 if (!obj)
42 dbgDoMethodNULLCount++;
43 D(bug("*** DoMethodNULL count: %d\n", dbgDoMethodNULLCount));
44 return 0L;
46 ASSERT_VALID_PTR(OCLASS(obj));
47 ASSERT_VALID_PTR(message);
49 return (CallHookPkt((struct Hook *) OCLASS(obj), obj, message));
50 } /* DoMethodA */
52 ULONG DoMethod(Object * obj, ULONG MethodID, ...)
54 AROS_SLOWSTACKMETHODS_PRE(MethodID)
56 dbgDoMethodCount++;
57 D(bug("*** DoMethod count: %d\n", dbgDoMethodCount));
59 ASSERT_VALID_PTR(obj);
61 if (!obj)
63 dbgDoMethodNULLCount++;
64 D(bug("*** DoMethodNULL count: %d\n", dbgDoMethodNULLCount));
65 retval = 0L;
67 else
69 ASSERT_VALID_PTR(OCLASS(obj));
70 retval = CallHookPkt
72 (struct Hook *) OCLASS(obj), obj,
73 AROS_SLOWSTACKMETHODS_ARG(MethodID)
77 AROS_SLOWSTACKMETHODS_POST
78 } /* DoMethod */
80 IPTR DoSuperMethodA(Class * cl, Object * obj, Msg message)
82 if ((!obj) || (!cl))
83 return 0L;
84 return CallHookPkt((struct Hook *) cl->cl_Super, obj, message);
85 } /* DoSuperMethodA */
87 ULONG DoSuperMethod(Class * cl, Object * obj, ULONG MethodID, ...)
89 AROS_SLOWSTACKMETHODS_PRE(MethodID)
91 if ((!obj) || (!cl))
92 retval = 0L;
93 else
94 retval = CallHookPkt
96 (struct Hook *) cl->cl_Super, obj,
97 AROS_SLOWSTACKMETHODS_ARG(MethodID)
100 AROS_SLOWSTACKMETHODS_POST
101 } /* DoSuperMethod */
103 /* Putchar procedure needed by RawDoFmt() */
104 AROS_UFH2(void, __putChr,
105 AROS_UFHA(UBYTE, chr, D0),
106 AROS_UFHA(STRPTR *, p, A3)
109 AROS_USERFUNC_INIT
111 *(*p)++ = chr;
113 AROS_USERFUNC_EXIT
116 VOID __sprintf(UBYTE * buffer, UBYTE * format, ...)
118 RawDoFmt(format, &format + 1, (VOID_FUNC) __putChr, &buffer);
119 } /* sprintf */