home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
new
/
dev
/
obero
/
oberon-a
/
source
/
obsolete
/
boopsiutil.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
4KB
|
135 lines
(*************************************************************************
$RCSfile: BoopsiUtil.mod $
Description: BOOPSI support routines.
Requires: ClassFace.obj must be explicitly linked with the program.
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/29 19:06:56 $
Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Library.
See Oberon-A.doc for conditions of use and distribution.
*************************************************************************)
<* STANDARD- *>
MODULE [4] BoopsiUtil ["Classface.obj"];
IMPORT SYS := SYSTEM, e := Exec, u := Utility, i := Intuition;
(*
** These procedures are duplicates of the ones found in Module Intuition.
** They are repeated here so that this module can be used in place of
** AmigaOberon's Classface.mod.
*)
(*------------------------------------*)
PROCEDURE [0] InstData* (cl : i.IClassPtr; o : i.ObjectPtr) : e.APTR;
BEGIN
RETURN SYS.VAL (e.APTR, (SYS.VAL(LONGINT,o) + LONG(cl.instOffset)));
END InstData;
(*------------------------------------*)
PROCEDURE [0] SizeOfInstance* (cl : i.IClassPtr) : LONGINT;
BEGIN
RETURN cl.instOffset + cl.instSize + SIZE(i.Object);
END SizeOfInstance;
(*------------------------------------*)
PROCEDURE [0] OClass* (o : i.ObjectPtr) : i.IClassPtr;
BEGIN
o := SYS.VAL (i.ObjectPtr, SYS.VAL (LONGINT, o) - SIZE (i.Object));
RETURN o.class
END OClass;
(*
** The following declarations are interfaces to procedures in
** ClassFace.obj, created by assembling ClassFace.asm. ClassFace.obj
** must be explicitly linked with the program in order to call these
** procedures. See the "Foreign Code" section in OC.doc.
**
** These procedures are replacements for those in Commodore's
** amiga.lib and small.lib.
**
** Thanks to Albert Weinert for providing the assembly source code.
*)
(*
** DoMethod( o, method_id, param1, param2, ... )
** Invoke upon an object the method function defined by an object's class.
** This function is the only one that you should use unless you are
** implementing a class.
*)
PROCEDURE DoMethodA * ["_a_DoMethodA"]
( obj [10] : i.ObjectPtr;
VAR msg [9] : i.Msg )
: e.APTR;
PROCEDURE DoMethod * ["_a_DoMethodA"]
( obj [10] : i.ObjectPtr;
msg [9]..: SYS.LONGWORD )
: e.APTR;
(*
** DoSuperMethod( cl, o, method_id, param1, param2, ... )
** Invoke upon an object the method defined for the superclass
** of the class specified. In a class implementation, you
** are passed a pointer to the class you are implementing, which
** you pass to this function to send a message to the object
** considered as a member of your superclass.
*)
PROCEDURE DoSuperMethodA * ["_a_DoSuperMethodA"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
VAR msg [9] : i.Msg )
: e.APTR;
PROCEDURE DoSuperMethod * ["_a_DoSuperMethodA"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
msg [9]..: SYS.LONGWORD )
: e.APTR;
(*
** CoerceMethod( cl, o, method_id, param1, param2, ... );
** Invoke upon the given object a method function for whatever
** specified class. This is sort of the primitive basis behind
** DoMethod and DoSuperMethod.
*)
PROCEDURE CoerceMethodA * ["_a_CoerceMethodA"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
VAR msg [9] : i.Msg );
PROCEDURE CoerceMethod * ["_a_CoerceMethodA"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
msg [9]..: SYS.LONGWORD );
(*
** SetSuperAttrs( cl, o, tag1, data1, ..., TAG_END );
** A useful varargs conversion to the proper OM_SET method.
*)
PROCEDURE SetSuperAttrsA * ["_a_SetSuperAttrs"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
tags [9] : ARRAY OF u.TagItem )
: e.APTR;
PROCEDURE SetSuperAttrs * ["_a_SetSuperAttrs"]
( cl [8] : i.IClassPtr;
obj [10] : i.ObjectPtr;
tags [9]..: u.Tag )
: e.APTR;
END BoopsiUtil.