#ifndef INTUITION_INTUITION_H
#define INTUITION_INTUITION_H

#ifndef TYPES_H
#include <types.h>
#endif

#ifndef GRAPHICS_RASTPORT_H
#include <graphics/rastport.h>
#endif

struct MenuItem
   {struct MenuItem *NextItem;
    SHORT  LeftEdge,TopEdge;
    SHORT  Width,Height;
    USHORT Flags;
    LONG   MutualExclude;
    APTR   ItemFill;
    APTR   SelectFill;
    BYTE   Command;
    struct MenuItem *Subitem;
    USHORT NextSelect;
    };

#define CHECKIT		0x0001
#define ITEMTEXT	0x0002
#define COMMSEQ 	0x0004
#define MENUTOGGLE	0x0008
#define ITEMENABLED	0x0010
#define HIGHFLAGS	0x0020
#define HIGHCOMP	0x0040
#define HIGHBOX 	0x0080
#define HIGHNONE	0x00C0
#define CHECKED 	0x0100
#define ISDRAWN 	0x1000
#define HIGHITEM	0x2000
#define MENUTOGGLED	0x4000


struct Menu
   {struct Menu *NextMenu;
    SHORT  LeftEdge,TopEdge;
    SHORT  Width,Height;
    USHORT Flags;
    BYTE   *MenuName;
    struct MenuItem *FirtsItem;
    SHORT  JazzX,JazzY,BeatX,BeatY;
    };

#define MENUENABLED 0x0001
#define MIDRAWN     0x0100

struct IntuiText
   {UBYTE  FrontPen,BackPen;
    UBYTE  DrawMode;
    SHORT  LeftEdge,TopEdge;
/*    struct TextAttr *ITextFont; */
    APTR   _ITextFont;	/* Temp bodge to save finding TextAttr */
    UBYTE  *IText;
    struct IntuiText *NextText;
    };

struct Gadget
   {struct Gadget *NextGadget;
    SHORT  LeftEdge,TopEdge;
    SHORT  Width,Height;
    USHORT Flags;
    USHORT Activation;
    USHORT GadgetType;
    APTR   GadgetRender;
    APTR   SelectRender;
    struct IntuiText *GadgetText;
    LONG   MutualExclude;
    APTR   SpecialInfo;
    USHORT GadgetID;
    APTR   UserData;
    };

/* Gadget types */
#define GADGETTYPE	0xfc00
#define SYSGADGET	0x8000
#define SCRGADGET	0x4000

#define SIZING		0x0010
#define WDRAGGING	0x0020
#define SDRAGGING	0x0030
#define WUPFRONT	0x0040
#define SUPFRONT	0x0050
#define WDOWNBACK	0x0060
#define SDOWNBACK	0x0070
#define CLOSE		0x0080

struct Window
   {struct Window *NextWindow;
    SHORT  LeftEdge,TopEdge;
    SHORT  Width,Height;
    SHORT  MouseX,MouseY;
    SHORT  MinWidth,MinHeight;
    SHORT  MaxWidth,MaxHeight;
    ULONG  Flags;
    struct Menu *MenuStrip;
    UBYTE  *Title;
    /* Quick and dirty hack, put APTRS not Requesters */
    APTR   _FirstRequest;
    APTR   _DMRequest;
    SHORT  ReqCount;
    /* QADH again */
    APTR   _WScreen;
    struct RastPort *RPort;
    BYTE   BorderLeft,BorderTop,BorderRight,BorderBottom;
    struct RastPort *BorderRPort;
    struct Gadget *FirstGadget;
    struct Window *Parent,*Descendant;
    USHORT *Pointer;
    BYTE   PtrHeight,PtrWidth;
    BYTE   XOffset,YOffset;
    ULONG  IDCMPFlags;
    struct MsgPort *UserPort,*WindowPort;
    APTR   _MessageKey;
    UBYTE  DetailPen,BlockPen;
    APTR   _CheckMark;
    UBYTE  *ScreenTitle;
    SHORT  GZZMouseX,GZZMouseY;
    SHORT  GZZWidth,GZZHeight;
    UBYTE  *ExtData;
    BYTE   *UserData;
    APTR   _WLayer;
    APTR   _IFont;
    };

#define WINDOWSIZING	0x0001
#define WINDOWDRAG	0x0002
#define WINDOWDEPTH	0x0004
#define WINDOWCLOSE	0x0008

#define SIZEBRIGHT	0x0010
#define SIZEBBOTTOM	0x0020

#define REFRESHBITS	0x00C0
#define SMART_REFRESH	0x0000
#define SIMPLE_REFRESH	0x0040
#define SUPER_BITMAP	0x0080
#define OTHER_REFRESH	0x00C0

#define BACKDROP	0x0100
#define REPORTMOUSE	0x0200
#define GIMMEZEROZERO	0x0400
#define BORDERLESS	0x0800
#define ACTIVATE	0x1000
#define WINDOWACTIVE	0x2000
#define INREQUEST	0x4000
#define MENUSTATE	0x8000

struct NewWindow
   {SHORT LeftEdge,TopEdge;
    SHORT Width,Height;
    UBYTE DetailPen,BlockPen;
    ULONG IDCMPFlags;
    ULONG Flags;
    struct Gadget *FirstGadget;
    APTR  _CheckMark;
    char  *Title;
    APTR  _Screen;
    APTR  _Bitmap;
    SHORT  MinWidth,MinHeight;
    SHORT  MaxWidth,MaxHeight;
    USHORT Type;
    };

/* Requester BoolInfo PropInfo StringInfo Border Image IntuiMessage */
/* not typed in */

#endif /* INTUITION_INTUITION_H */
