#ifndef BOOPSILIB_H
#define BOOPSILIB_H

#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif

#ifndef INTUITION_CLASSUSR_H
#include <intuition/classusr.h>
#endif

/************************************************************************/

#define BOOPSILib_Base			(TAG_USER | 100000)

/************************************************************************/

struct BOOPSILibS_MinMax
{
  WORD Min;
  WORD Max;
};

struct BOOPSILibS_LayoutInfo
{
  struct BOOPSILibS_MinMax Width;
  struct BOOPSILibS_MinMax Height;
  UWORD Weight;

  UWORD Group;				/* for use by Group class */
};

struct BOOPSILibS_Fraction
{
  WORD Numerator;
  WORD Denominator;
};

/************************************************************************/

#define BOOPSILibA_Weight		(BOOPSILib_Base+0)
#define BOOPSILibA_LayoutInfo		(BOOPSILib_Base+1)
#define BOOPSILibA_Frame		(BOOPSILib_Base+2)
#define BOOPSILibA_ControlChar		(BOOPSILib_Base+3)

#define BOOPSILibM_Layout		(BOOPSILib_Base+0)
#define BOOPSILibM_Init			(BOOPSILib_Base+1)
#define BOOPSILibM_ControlChar		(BOOPSILib_Base+2)

struct BOOPSILibP_Layout
{
  ULONG MethodID;
  Object *Root;
  struct IBox Position;
  const struct GadgetInfo *GadgetInfo;
};

struct BOOPSILibP_Init
{
  ULONG MethodID;
  Object *Root;
  struct Screen *Screen;
  struct DrawInfo *DrawInfo;
  struct TextFont *Font;
};

struct BOOPSILibP_ControlChar
{
  ULONG MethodID;
  const struct GadgetInfo *GadgetInfo;
  ULONG Code;
};

/************************************************************************/

#define BOOPSILib_Frame			(BOOPSILib_Base+20)

#define BOOPSILibA_Frame_Fake		(BOOPSILib_Frame+0)
#define BOOPSILibA_Frame_Gadget		(BOOPSILib_Frame+1)
#define BOOPSILibA_Frame_Space		(BOOPSILib_Frame+2)

/************************************************************************/

#define BOOPSILib_Group			(BOOPSILib_Base+40)

#define BOOPSILibA_Group_Horizontal	(BOOPSILib_Group+0)
#define BOOPSILibA_Group_Child		(BOOPSILib_Group+1)
#define BOOPSILibA_Group_Spacing	(BOOPSILib_Group+2)
#define BOOPSILibA_Group_Justify	(BOOPSILib_Group+3)
#define BOOPSILibA_Group_Children	(BOOPSILib_Group+4)
#define BOOPSILibA_Group_SameSize	(BOOPSILib_Group+5)

#define BOOPSILibV_Group_Justify_Center	0
#define BOOPSILibV_Group_Justify_Left	-1
#define BOOPSILibV_Group_Justify_Right	1
#define BOOPSILibV_Group_Justify_Top	BOOPSILibV_Group_Justify_Left
#define BOOPSILibV_Group_Justify_Bottom	BOOPSILibV_Group_Justify_Right

/************************************************************************/

#define BOOPSILib_Root			(BOOPSILib_Base+60)

#define BOOPSILibA_Root_VisualInfo	(BOOPSILib_Root+0)

#define BOOPSILibM_Root_ProcessMessage	(BOOPSILib_Root+0)
#define BOOPSILibM_Root_AddGadget	(BOOPSILib_Root+1)
#define BOOPSILibM_Root_ReplyMessage	(BOOPSILib_Root+2)
#define BOOPSILibM_Root_Init		(BOOPSILib_Root+3)
#define BOOPSILibM_Root_RequestKey	(BOOPSILib_Root+4)

struct BOOPSILibP_Root_ProcessMessage
{
  ULONG MethodID;
  struct IntuiMessage *Message;
};

struct BOOPSILibP_Root_AddGadget
{
  ULONG MethodID;
  struct Gadget *Gadget;
};

struct BOOPSILibP_Root_ReplyMessage
{
  ULONG MethodID;
  struct IntuiMessage *Message;
};

struct BOOPSILibP_Root_Init
{
  ULONG MethodID;
  struct TagItem *WindowTags;
  WORD SizeY, SizeX;
};

struct BOOPSILibP_Root_RequestKey
{
  ULONG MethodID;
  Object *TheObject;
  ULONG Key;
};

/************************************************************************/

extern struct IClass *BOOPSILibC_Root;
extern struct IClass *BOOPSILibC_Group;
extern struct IClass *BOOPSILibC_Frame;
extern struct IClass *BOOPSILibC_String;
extern struct IClass *BOOPSILibC_Button;
extern struct IClass *BOOPSILibC_Label;

struct IClass *CreateBOOPSILibC_Root(void);
struct IClass *CreateBOOPSILibC_Group(void);
struct IClass *CreateBOOPSILibC_Frame(void);
struct IClass *CreateBOOPSILibC_String(void);
struct IClass *CreateBOOPSILibC_Group(void);
struct IClass *CreateBOOPSILibC_Button(void);
struct IClass *CreateBOOPSILibC_Label(void);

/************************************************************************/

#define BOOPSILibO(Type) NewObject(BOOPSILibC_##Type,NULL
#define BOOPSILibO_End   TAG_DONE)

/************************************************************************/

#define BOOPSILIBERROR_SCREENTOSMALL	(-1)

/************************************************************************/

#endif /* BOOPSILIB_H */
