home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Programming / yaec / modules / intuition / classes.e < prev    next >
Encoding:
Text File  |  2001-08-12  |  1.0 KB  |  49 lines

  1. OPT MODULE
  2. OPT EXPORT
  3.  
  4. OPT PREPROCESS
  5.  
  6. MODULE 'exec/libraries',
  7.        'exec/nodes',
  8.        'intuition/classusr',
  9.        '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. /* yaec : fixed paramname -- can not start with "_" */
  40. #define BASEOBJECT(obj_) ((obj_)+SIZEOF object)
  41. #define _OBJECT(o) ((o)-SIZEOF object)
  42. #define OCLASS(o) (Long(_OBJECT(o)+OJ_CLASS))
  43.  
  44. OBJECT classlibrary
  45.   lib:lib
  46.   pad:INT
  47.   class:PTR TO iclass
  48. ENDOBJECT
  49.