home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BC_DICE2.DMS / in.adf / INCLUDE / intuition / classes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-10  |  1.1 KB  |  77 lines

  1. #ifndef INTUITION_CLASSES_H
  2. #define INTUITION_CLASSES_H 1
  3. /*
  4. ** $Filename: intuition/classes.h $
  5. ** $Release: 2.04 Includes, V37.4 $
  6. ** $Revision: 36.2 $
  7. ** $Date: 91/11/08 $
  8. **
  9. ** Used only by class implementors
  10. **
  11. ** (C) Copyright 1989-1991 Commodore-Amiga, Inc.
  12. ** All Rights Reserved
  13. */
  14.  
  15. #ifndef UTILITY_HOOKS_H
  16. #include <utility/hooks.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_CLASSUSR_H
  20. #include <intuition/classusr.h>
  21. #endif
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. typedef struct IClass {
  29.  struct Hook cl_Dispatcher;
  30.  ULONG cl_Reserved; 
  31.  struct IClass *cl_Super;
  32.  ClassID cl_ID;
  33.  
  34.  
  35.  UWORD cl_InstOffset;
  36.  UWORD cl_InstSize;
  37.  
  38.  ULONG cl_UserData; 
  39.  ULONG cl_SubclassCount;
  40.  
  41.  ULONG cl_ObjectCount;
  42.  
  43.  ULONG cl_Flags;
  44. #define CLF_INLIST 0x00000001 
  45. } Class;
  46.  
  47.  
  48. #define INST_DATA( cl, o ) ((VOID *) (((UBYTE *)o)+cl->cl_InstOffset))
  49.  
  50.  
  51. #define SIZEOF_INSTANCE( cl ) ((cl)->cl_InstOffset + (cl)->cl_InstSize \
  52.  + sizeof (struct _Object ))
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. struct _Object {
  60.  struct MinNode o_Node;
  61.  struct IClass *o_Class;
  62. };
  63.  
  64.  
  65. #define _OBJ( o ) ((struct _Object *)(o))
  66.  
  67.  
  68. #define BASEOBJECT( _obj ) ( (Object *) (_OBJ(_obj)+1) )
  69.  
  70.  
  71. #define _OBJECT( o ) (_OBJ(o) - 1)
  72.  
  73.  
  74. #define OCLASS( o ) ( (_OBJECT(o))->o_Class )
  75.  
  76. #endif
  77.