type
    Gadget_t = struct {
	*Gadget_t g_NextGadget;
	
	uint g_LeftEdge, g_TopEdge;
	uint g_Width, g_Height;
	
	uint g_Flags;
	uint g_Activation;
	uint g_GadgetType;
	
	*byte g_GadgetRender;
	*byte g_SelectRender;
	
	*IntuiText_t g_GadgetText;
	
	ulong g_MutualExclude;
	
	*byte g_SpecialInfo;
	
	uint g_GadgetID;
	*byte g_UserData;
    };

uint
    GADGHIGHBITS= 0x0003,
    GADGHCOMP	= 0x0000,
    GADGHBOX	= 0x0001,
    GADGHIMAGE	= 0x0002,
    GADGHNONE	= 0x0003,

    GADGIMAGE	= 0x0004,

    GRELBOTTOM	= 0x0008,
    GRELRIGHT	= 0x0010,
    GRELWIDTH	= 0x0020,
    GRELHEIGHT	= 0x0040,

    SELECTED	= 0x0080,

    GADGDISABLED= 0x0100;

uint
    RELVERIFY	= 0x0001,

    GADGIMMEDIATE=0x0002,

    ENDGADGET	= 0x0004,

    FOLLOWMOUSE = 0x0008,

    RIGHTBORDER = 0x0010,
    LEFTBORDER	= 0x0020,
    TOPBORDER	= 0x0040,
    BOTTOMBORDER= 0x0080,

    TOGGLESELECT= 0x0100,

    STRINGCENTER= 0x0200,
    STRINGRIGHT = 0x0400,

    LONGINT	= 0x0800,

    ALTKEYMAP	= 0x1000,

    BOOLEXTEND	= 0x2000;

uint
    GADGETTYPE	= 0xFC00,
    SYSGADGET	= 0x8000,
    SCRGADGET	= 0x4000,
    GZZGADGET	= 0x2000,
    REQGADGET	= 0x1000,

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

    BOOLGADGET	= 0x0001,
    GADGET002	= 0x0002,
    PROPGADGET	= 0x0003,
    STRGADGET	= 0x0004;

type
    BoolInfo_t = struct {
	uint bi_Flags;
	*uint bi_Mask;
	ulong bi_Reserved;
    };

uint
    BOOLMASK	= 0x0001;

type
    PropInfo_t = struct {
	uint pi_Flags;
	
	uint pi_HorizPot;
	uint pi_VertPot;
	
	uint pi_HorizBody;
	uint pi_VertBody;
	
	uint pi_CWidth;
	uint pi_CHeight;
	uint pi_HPotRes, pi_VPotRes;
	uint pi_LeftBorder;
	uint pi_TopBorder;
    };

uint
    AUTOKNOB	= 0x0001,
    FREEHORIZ	= 0x0002,
    FREEVERT	= 0x0004,
    PROPBORDERLESS = 0x0008,
    KNOBHIT	= 0x0100;

uint
    KNOBHMIN	= 6,
    KNOBVMIN	= 4,
    MAXBODY	= 65535,
    MAXBOT	= 65535;

type
    StringInfo_t = struct {
	*char si_Buffer;
	*char si_UndoBuffer;
	uint si_BufferPos;
	uint si_MaxChars;
	uint si_DispPos;
	
	uint si_UndoPos;
	uint si_NumChars;
	uint si_DispCount;
	int si_CLeft, si_CTop;
	*Layer_t si_LayerPtr;
	
	long si_LongInt;
	
	*KeyMap_t si_AltKeyMap;
    };

extern
    ActivateGadget(*Gadget_t g; *Window_t w; *Requester_t r)bool,
    AddGadget(*Window_t w; *Gadget_t g; ulong position)ulong,
    AddGList(*Window_t w; *Gadget_t g; ulong position; long numGad;
	     *Requester_t r)ulong,
    ModifyProp(*Gadget_t g; *Window_t w; *Requester_t r; ulong flags;
	       ulong horizPot, vertPot, horizBody, vertBody)void,
    NewModifyProp(*Gadget_t g; *Window_t w; *Requester_t r; ulong flags;
		  ulong horizPot, vertPot, horizBody, vertBody;
		  long numGad)void,
    OffGadget(*Gadget_t g; *Window_t w; *Requester_t r)void,
    OnGadget(*Gadget_t g; *Window_t w; *Requester_t r)void,
    RefreshGadgets(*Gadget_t g; *Window_t w; *Requester_t r)void,
    RefreshGList(*Gadget_t g; *Window_t w; *Requester_t r; long numGad)void,
    RemoveGadget(*Window_t w; *Gadget_t g)long,
    RemoveGList(*Window_t w; *Gadget_t g; long numGad)long;
