/*
** includes + classbase definition for the bmp.datatype
*/

#include <exec/types.h>

#if !defined(__GNUC__)
#define REG(x)
#else
#define REG(x) asm(#x)
#endif

#include <exec/memory.h>
#include <dos/dos.h>
#include <graphics/gfx.h>
#include <datatypes/pictureclass.h>
#include <datatypes/pictureclassext.h>

struct ClassBase {
  struct Library          cb_Library;
  UWORD                   cb_Pad1;
  BPTR                    cb_SegList;
  struct ExecBase        *cb_SysBase;
  struct DosLibrary      *cb_DOSBase;
  struct IntuitionBase   *cb_IntuitionBase;
  struct GfxBase         *cb_GfxBase;
  struct UtilityBase     *cb_UtilityBase;
  struct Library         *cb_DataTypesBase;
  struct Library         *cb_SuperClassBase;
  struct IClass          *cb_BMPClass;
  struct SignalSemaphore  cb_Lock;
  UWORD                   cb_Pad2;
};

#define DATATYPES_BASE_NAME cb->cb_DataTypesBase
#include <proto/datatypes.h>

#define GRAPHICS_BASE_NAME cb->cb_GfxBase
#include <proto/graphics.h>

#define UTILITY_BASE_NAME cb->cb_UtilityBase
#include <proto/utility.h>

#define EXEC_BASE_NAME cb->cb_SysBase
#include <proto/exec.h>

#define DOS_BASE_NAME cb->cb_DOSBase
#include <proto/dos.h>

/*
** our `anchor'
*/

REGISTER struct ClassBase *cb REG(a4);

/*
** majik ;-(
*/

#include "mathsup.h"
