#ifndef IEDIT_EXPANDER_H
#define IEDIT_EXPANDER_H
/*
**      Interface Editor expanders definitions.
**
**      (C) Copyright 1996 Simone Tellini
**          All Rights Reserved
*/

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

#ifndef IEDIT_IEDIT_H
#include "DEV_IE:Include/IEditor.h"
#endif
#ifndef IEDIT_GENERATOR_H
#include "DEV_IE:Include/generatorlib.h"
#endif



/*********************
**   ExpanderBase   **
*********************/

struct Expander {
	struct Library          Lib;
	struct Node             Node;       /* node displayed in the Add   */
					    /* Gadget list                 */
	UBYTE                   Kind;       /* Kind of expander. See below */
	UBYTE                   Resizable;  /* can this object be resized? */
	UBYTE                   Movable;    /* can we be moved?            */
	UBYTE                   HasItems;   /* has items (like MX_KIND)?   */
	UBYTE                   UseFonts;   /* we use a font?              */
	UBYTE                   Reserved;   /* for future use              */
	UWORD                   Width;      /* fixed size. Used when       */
	UWORD                   Height;     /* Resizable = FALSE;          */
};


/*  Expander Kinds        */

#define IEX_OBJECT_KIND     0       /* we add objects                      */



/************************
**  Objects structure  **
************************/

/*
    This is the standard object structure. If your object should appear
    as any other IE gadget, then it MUST use a structure whose fields
    match these. Anyway, if your object has set Resizable = FALSE,
    Movable = FALSE and HasItems = FALSE, you can change the structure
    as you want, provided that the first three fields (o_Node, o_Kind,
    o_Flags) aren't taken away, otherwise IE could wonder what sort of
    object it has found in its list... ;-)
*/

struct ObjectInfo {
	struct  Node o_Node;
	UWORD   o_Kind;         /* fill with the ID passed by IE    */
	UBYTE   o_Flags;        /* used by IE                       */
				/* you can only check the G_ATTIVO  */
				/* bit (means that this object is   */
				/* selected)                        */
	UBYTE   o_Key;          /* if you're object has a selection */
				/* key you must put it here and     */
				/* increment the wi_NumKeys field   */
				/* of the gadget's window info      */
	struct TxtAttrNode *o_Font; /* if your object supports fonts*/
				/* here you'll find a ptr to a      */
				/* TxtAttrNode structure when the   */
				/* user selects Gadgets/Font...     */
	UBYTE   o_Title[80];    /* title  */
	UBYTE   o_Label[40];    /* label  */
	APTR    o_User1;        /* use it as you like               */
	WORD    o_Left;         /* this fields are updated by IE if */
	WORD    o_Top;          /* your object is resizable/movable */
	UWORD   o_Width;
	UWORD   o_Height;
	APTR    o_User2;        /* all these fields are for your    */
	APTR    o_User3;        /* use. If your object doesn't have */
	WORD    o_User4;        /* items (HasItems = FALSE) and you */
	APTR    o_User5;        /* don't need these fields, then    */
	APTR    o_User6;        /* allocate a shorter structure ;-) */
	APTR    o_User7;        /* But if you're object has items,  */
	APTR    o_User8;        /* you'll have to allocate them even*/
	APTR    o_User9;        /* if it's just a waste of memory,  */
	ULONG   o_User10[7];    /* for compatibility... :-|         */
	UWORD   o_NumItems;     /* num items if HasItems = TRUE     */
	struct MinList o_Items; /* item list                        */
};



/******************
**  Descriptors  **
******************/

struct Descriptor {
	UBYTE   Key;        /* character following '%' */
	STRPTR  Meaning;    /* the string that must be put instead of */
			    /* the formatting code                    */
};


/******************
**  Error codes  **
******************/


#define IEX_OK                  0
#define IEX_ERROR_NO_DESC_FILE  1   /* source descriptor file not found   */


#endif  /*  IEDIT_EXPANDER_H  */
