/* Definitionen für FileRequester */

#ifndef	DSIZE
#define	DSIZE 130
#define	FCHARS	30
#endif	/* ifndef DSIZE */

#define	WILDLENGTH	30

/*
	These  are	the  bit  numbers  of various bits that you can set in the
Flags  field of the file requester structure.  The actual values that come
out of these bit numbers are defined in the set of includes below with the
same	names  but	with	an  M  (for  mask) ending instead of a B (for bit)
ending.
	*/

#define	FRQSHOWINFOB	0	/*Set this in Flags if you want .info files to show.	They default to hidden.*/
#define	FRQEXTSELECTB	1	/*Set this in Flags if you want extended select.  Default is not.*/
#define	FRQCACHINGB 	2	/*Set this in Flags if you want directory caching.  Default is not.*/
#define	FRQGETFONTSB	3	/*Set this in Flags if you want a font requester rather than a file requester.*/
#define	FRQINFOGADGETB 4	/*Set this in Flags if you want a hide-info files gadget.*/
#define	FRQHIDEWILDSB	5	/*Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*/
#define	FRQABSOLUTEXYB 6	/*Use absolute x,y positions rather than centering on mouse.*/
#define	FRQCACHEPURGEB 7	/*Purge the cache whenever the directory date stamp changes if this is set.*/
#define	FRQNOHALFCACHEB	8	/*Don't cache a directory unless it is completely read in when this is set.*/
#define	FRQNOSORTB		9	/*Set this in Flags if you DON'T want sorted directories.*/
#define	FRQNODRAGB		10 /*Set this in Flags if you DON'T want a drag bar and depth gadgets.*/
#define	FRQSAVINGB		11 /*Set this bit if you are selecting a file to save to.*/
#define	FRQLOADINGB 	12 /*Set this bit if you are selecting a file(s) to load from.*/
							/*These two bits (save and load) aren't currently used for*/
							/*anything, but they may be in the future, so you should*/
							/*remember to set them.  Also, these bits make it easier if*/
							/*somebody wants to customize the file requester for their*/
							/*machine.	They can make it behave differently for loading*/
							/*vs saving.*/
#define	FRQDIRONLYB 	13 /* Allow the user to select a directory, rather than a file.*/
#define	FRQNODEPTHB 	14 /* Keine Window2Back/Front Gadgets */
/*
	These  are the mask values that you can OR into the Flags field of the
file requester structure.
	*/

#define	FRQSHOWINFOM	(1<<FRQSHOWINFOB)
#define	FRQEXTSELECTM	(1<<FRQEXTSELECTB)
#define	FRQCACHINGM 	(1<<FRQCACHINGB)
#define	FRQGETFONTSM	(1<<FRQGETFONTSB)
#define	FRQINFOGADGETM (1<<FRQINFOGADGETB)
#define	FRQHIDEWILDSM	(1<<FRQHIDEWILDSB)
#define	FRQABSOLUTEXYM (1<<FRQABSOLUTEXYB)
#define	FRQCACHEPURGEM (1<<FRQCACHEPURGEB)
#define	FRQNOHALFCACHEM	(1<<FRQNOHALFCACHEB)
#define	FRQNOSORTM		(1<<FRQNOSORTB)
#define	FRQNODRAGM		(1<<FRQNODRAGB)
#define	FRQSAVINGM		(1<<FRQSAVINGB)
#define	FRQLOADINGM 	(1<<FRQLOADINGB)
#define	FRQDIRONLYM 	(1<<FRQDIRONLYB)
#define	FRQNODEPTHM 	(1<<FRQNODEPTHB)

struct ESStructure
	{
	struct ESStructure	*NextFile;
	WORD	NameLength; 		/* Length of thefilename field, not including the terminating zero. */
	WORD	Pad;
	APTR	Node; 			/* For internal use only. */
	char	thefilename[1];		/* This is a variable size field. */
	};

struct RCTFileRequester
	{
	UWORD VersionNumber; 			/* Make sure this is set to REQVERSION. */

	char	*Title;						/* Hailing text */
	char	*Dir; 					/* Directory array (DSIZE+1) */
	char	*File;						/* Filename array (FCHARS+1) */

	char	*PathName;					/* Complete path name array (DSIZE+FCHARS+2) */

	struct Window	*Window; 		/* Window requesting or NULL */


	UWORD MaxExtendedSelect;			/* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*/
	UWORD numlines;					/* Number of lines in file window. */
	UWORD numcolumns; 				/* Number of columns in file window. */
	UWORD devcolumns;
	ULONG Flags;						/* Various - umm - flags.	See above for more info. */
	UWORD dirnamescolor; 		/* These five colors will all default */
	UWORD filenamescolor;			/* to color one if you don't specify */
	UWORD devicenamescolor; 	/* a color (ie; if you specify color zero). */
	UWORD fontnamescolor;			/* If you want color zero to be used, specify */
	UWORD fontsizescolor;			/* color 32, or some other too large number */
									/* which mods down to zero. */

	UWORD detailcolor;			/* If both of these colors are specified as */
	UWORD blockcolor; 			/* zero then the block pen will be set to one. */

	UWORD gadgettextcolor;		/* The color for the text of the five boolean gadgets.  Defaults to 1. */
	UWORD textmessagecolor; 	/* The color for the message at the screen top.  Defaults to 1. */
	UWORD stringnamecolor;		/* The color for the words Drawer, File, Hide and Show.	Defaults to 3. */
	UWORD stringgadgetcolor;		/* The color for the borders of the string gadgets.  Defaults to 3. */
									/* Unfortunately it is not possible to specify */
									/* the color of the actual text in an Intuition */
									/* string gadget. */
	UWORD boxbordercolor;			/* The color for the boxes around the file and directory areas.  Defaults to 3. */
	UWORD gadgetboxcolor;			/* The color for the boxes around the five boolean gadgets.  Defaults to 3. */

	UWORD FRU_Stuff[18]; 			/* This area, which is reserved for */
										/* future use, should all be zero. */

	struct DateStamp	DirDateStamp;	/* A copy of the cached directories date stamp. */
										/* There should never be any need to change this. */

	UWORD WindowLeftEdge;			/* These two fields are used for the Center */
	UWORD WindowTopEdge; 		/* function. See the Center() function docs */
									/* for their explanation.*/

	UWORD FontYSize;				/* These fields are used to return the selected */
	UWORD FontStyle;				/* font size and style, only applicable when the */
									/* font bit is set. */

	/*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*/
	struct ESStructure *ExtendedSelect;
	char	Hide[WILDLENGTH+2];		/* The wildcards text. */
	char	Show[WILDLENGTH+2];		/* More wildcards text. */
	WORD	FileBufferPos; 		/* Various fields taken from the various */
	WORD	FileDispPos;			/* string gadgets so that the cursor */
	WORD	DirBufferPos;			/* can be returned to the same position */
	WORD	DirDispPos; 			/* on subsequent calls. */
	WORD	HideBufferPos;
	WORD	HideDispPos;
	WORD	ShowBufferPos;
	WORD	ShowDispPos;

/**;		 The	following  fields are PRIVATE!  Don't go messing with them or
; wierd	things may/will happen.  If this isn't enough of a warning, go read
; the one in intuition.h, that should scare you off.**/

	APTR	Memory;						/* Memory allocate for dir entries. */
	APTR	Memory2; 				/* More memory, used for hidden files. */
	APTR	Lock;
	char	PrivateDirBuffer[DSIZE+2]; /* Used for keeping a record of which */
										/* directory we have file names for. */
	struct FileInfoBlock *FileInfoBlock;
	WORD	NumEntries;
	WORD	NumHiddenEntries;
	WORD	filestartnumber;
	WORD	devicestartnumber;
	};

/* ************* Protos aus RCT Library *********** */

LONG *rctload( char *pfad);
boolean rctfree( void *base);
void *rctaddr( void *base, long art, long id);
boolean reqcenter( void *base, struct Requester *req, struct Window *win);
boolean reqdraw( void *base, struct Requester *req, struct Window *win);
boolean reqend( void *base, struct Requester *req, struct Window *win);
LONG getreqstruct( void *base, struct Requester *req, long item);
boolean setreqstruct( void *base, struct Requester *req, long item, long wert);
boolean setreqtext( void *base, struct Requester *req, long id, char *text);
char *getreqtext( void *base, struct Requester *req, long id);
LONG gettextstruct( void *base, struct Requester *req, long id, long item);
boolean settextstruct( void *base, struct Requester *req, long id, long item, long wert);
boolean setgadtext( void *base, struct Requester *req, long id, char *text);
char *getgadtext( void *base, struct Requester *req, long id);
long getgadstruct( void *base, struct Requester *req, long id, long item);
boolean setgadstruct( void *base, struct Requester *req, long id, long item, long wert);
boolean redrawgadgets( void *base, struct Requester *req, long id);
boolean redrawgad( void *base, struct Requester *req, long id, long anzahl);
boolean aktivegad( void *base, struct Requester *req, long id);
boolean setstrgadtext( void *base, struct Requester *req, long id, char *text);
char *getstrgadtext( void *base, struct Requester *req, long id);
LONG getstrgadstruct( void *base, struct Requester *req, long id, long item);
boolean setstrgadstruct( void *base, struct Requester *req, long id, long item, long wert);
boolean setpropgadstruct( void *base, struct Requester *req, long id, long item, LONG wert);
LONG getpropgadstruct( void *base, struct Requester *req, long id, long item);
boolean menudraw( void *base, struct Menu *men, struct Window *win);
boolean menuend( void *base, struct Menu *men, struct Window *win);
boolean setmenutitle( void *base, struct Menu *men, long id, char *text);
char *getmenutitle( void *base, struct Menu *men, long id);
boolean setmenustruct( void *base, struct Menu *men, long id, long item, void *wert);
short getmenustruct( void *base, struct Menu *men, long id, long item);
boolean setmenuitext( void *base, struct Menu *men, long id, long nid, char *text);
char *getmenuitext( void *base, struct Menu *men, long id, long nid);
boolean setmenuitemstruct( void *base, struct Menu *men, long id, long nid, long item, void *wert);
void *getmenuitemstruct( void *base, struct Menu *men, long id, long nid, long item);
boolean setmenustext( void *base, struct Menu *men, long id, long nid, long sid, char *text);
char *getmenustext( void *base, struct Menu *men, long id, long nid, long sid);
boolean setmenusubstruct( void *base, struct Menu *men, long id, long nid, long sid, long item, void *wert);
LONG getmenusubstruct( void *base, struct Menu *men, long id, long nid, long sid, long item);
struct Window *reqdrawwindow( void *base, struct Requester *req, struct Screen *scr, char *titel);
unsigned short reqwait( void *base, struct Requester *req, ULONG *class);
/*showscreen
remscreen*/
SHORT form_alert( long md, char *str);
SHORT filer(struct RCTFileRequester *filreq);

