home *** CD-ROM | disk | FTP | other *** search
- ''
- '' $Id: BOOPSISupport.bas,v 1.2 1994/03/07 17:26:09 alex Rel $
- ''
- '' BASIC BOOPSI Amiga.lib support functions (plus some macros)
- ''
- '' (c) Copyright 1994 HiSoft
- ''
-
- 'REM $INCLUDE Utility.bh ' note the library _is_ required for CallHookPkt()
- 'REM $INCLUDE Intuition.bc
-
- '
- ' add offset for instance data to an object handle
- '
- FUNCTION INST_DATA&(BYVAL cl&, BYVAL o&)
- INST_DATA& = o& + PEEKW(cl& + cl_InstOffset%)
- END FUNCTION
-
- '
- ' sizeof the instance data for a given class
- '
- FUNCTION SIZEOF_INSTANCE&(BYVAL cl&)
- SIZEOF_INSTANCE& = PEEKW(cl& + cl_InstOffset%) + PEEKW(cl& + cl_InstSize%) + _
- (MinNode_sizeof% + 4%)
- END FUNCTION
-
- '
- ' get class pointer from an object handle
- '
- FUNCTION OCLASS&(BYVAL o&)
- OCLASS& = PEEKL(o& - (MinNode_sizeof% + 4%) + o_Class%)
- END FUNCTION
-
- '
- ' Perform method on coerced object.
- '
- FUNCTION CoerceMethodA&(cl&, o&, msg&)
- CoerceMethodA& = CallHookPkt&(cl& + cl_Dispatcher%, o&, msg&)
- END FUNCTION
-
- '
- ' Perform method on object
- '
- FUNCTION DoMethodA&(o&, msg&)
- DoMethodA& = CoerceMethodA&(OCLASS&(o&), o&, msg&)
- END FUNCTION
-
- '
- ' Perform method on object coerced to superclass
- '
- FUNCTION DoSuperMethodA&(BYVAL cl&, BYVAL o&, BYVAL msg&)
- DoSuperMethodA& = CoerceMethodA&(PEEKL(cl& + cl_Super%), o&, msg&)
- END FUNCTION
-