home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / YAEC / modules / intuition / classes.e < prev    next >
Encoding:
Text File  |  2001-02-23  |  991 b   |  48 lines

  1. OPT MODULE
  2. OPT EXPORT
  3.  
  4. OPT PREPROCESS
  5.  
  6. MODULE 'exec/libraries'
  7. MODULE 'exec/nodes'
  8. MODULE 'intuition/classusr'
  9. MODULE 'utility/hooks'
  10.  
  11. OBJECT iclass
  12.   dispatcher:hook
  13.   reserved:LONG
  14.   super:PTR TO iclass
  15.   id:LONG
  16.   instoffset:INT -> This is unsigned
  17.   instsize:INT   -> This is unsigned
  18.   userdata:LONG
  19.   subclasscount:LONG
  20.   objectcount:LONG
  21.   flags:LONG
  22. ENDOBJECT     /* SIZEOF=NONE !!! */
  23.  
  24. CONST CLB_INLIST=0,
  25.       CLF_INLIST=1
  26.  
  27. -> instoffset and instsize are unsigned so AND with $FFFF
  28. #define INST_DATA(cl, o) ((o)+(cl::iclass.instoffset AND $FFFF))
  29. #define SIZEOF_INSTANCE(cl) ((cl::iclass.instoffset AND $FFFF)+(cl::iclass.instsize AND $FFFF)+SIZEOF object)
  30.  
  31. CONST OJ_CLASS=8
  32.  
  33. OBJECT object
  34.   node:mln
  35.   class:PTR TO iclass
  36. ENDOBJECT     /* SIZEOF=12 */
  37.  
  38. #define _OBJ(o) (o)
  39. #define BASEOBJECT(_obj) ((_obj)+SIZEOF object)
  40. #define _OBJECT(o) ((o)-SIZEOF object)
  41. #define OCLASS(o) (Long(_OBJECT(o)+OJ_CLASS))
  42.  
  43. OBJECT classlibrary
  44.   lib:lib
  45.   pad:INT
  46.   class:PTR TO iclass
  47. ENDOBJECT
  48.