/*

Filename: kdbase.h
Release : 3.10
Date    : 29 March 1992

(C) 1990-1992 Khalid Aldoseri

*/


#define KLIBNAME		"kd_freq.library"
#define	KLIBVERSION		3L

#define	FRB_PRIVATE		0L	/* Private flag - do not use */
#define	FRB_DUALWILD		1L	/* Dual wildcard facility */
#define FRB_NOINFO		2L	/* Don't show .info files */
#define	FRB_NOTITLEBAR		3L	/* No titlebar/dragbar/front/back/close gads */
#define FRB_AUTOPOSITION	4L	/* Use autopositioning */
#define FRB_AUTOSIZE		5L	/* Use autosizing */
#define FRB_NORESIZE		6L	/* Forbid resizing */
#define FRB_OKTEXT		7L	/* New OK text defined */
#define FRB_FRONTSCREEN		8L	/* Show up on front screen */
#define FRB_NOTEXTSHADOW	9L	/* Do not use text shadows */
#define FRB_REPLACEIMAGES	10L	/* Give user program images to FR */
#define FRB_CANCELTEXT		11L	/* New Cancel text defined */
#define FRB_NEWFONT		12L	/* Use a special font */
#define FRB_SCREENFONT		13L	/* Use the screen's font */
#define FRB_EXTENDEDSELECT	14L	/* -- old flag -- use SELECTLIST instead -- */
#define FRB_INVERTLOOK		15L	/* Gives an inverted look.. use for Save */
#define FRB_HIDEWILD		16L	/* Hide Wildcard to be defined in extras->Hide */
#define FRB_NEWLOOK		17L	/* Make FR use that WB 2.0 look */
#define FRB_NONEWLOOK		18L	/* Disable auto-enable of FR_NEWLOOK */
#define FRB_SELECTLIST		19L	/* Allow user to select multiple files */
#define	FRB_SLSHOWNAMES		20L	/* Show filenames only in Select List */
#define	FRB_KEEPBUFFERS		21L	/* Don't flush buffers at exit. i.e. next
					   call of NewFReq() will not re-read the
					   directories. */
#define	FRB_EXTRABUTTONS	22L	/* Activate the ExtraButtons feature */
#define FRB_SELECTLISTTIME	23L	/* The select list is returned to the caller
					   with the files in order of their selection
					   and not sorted alphabetically */
#define FRB_DIRSONLY		24L	/* Only show/select directories */
#define FRB_USEPENS		25L	/* Makes FR uses pens defined in extras struct */
					/* note that higher pen numbers cause slower
						rendering speed. */

#define	FRB_SPECIAL2		29L	/* Private flag - do not use */
#define	FRB_SPECIAL1		30L	/* Private flag - do not use */
#define	FRB_INUSE		31L	/* Private flag - do not use */


#define	FR_PRIVATE		1L << FRB_PRIVATE		/* !! */
#define	FR_DUALWILD		1L << FRB_DUALWILD
#define FR_NOINFO		1L << FRB_NOINFO		/* !! */
#define	FR_NOTITLEBAR		1L << FRB_NOTITLEBAR
#define FR_AUTOPOSITION		1L << FRB_AUTOPOSITION
#define FR_AUTOSIZE		1L << FRB_AUTOSIZE
#define FR_NORESIZE		1L << FRB_NORESIZE
#define FR_OKTEXT		1L << FRB_OKTEXT
#define FR_FRONTSCREEN		1L << FRB_FRONTSCREEN
#define FR_NOTEXTSHADOW		1L << FRB_NOTEXTSHADOW
#define FR_REPLACEIMAGES	1L << FRB_REPLACEIMAGES
#define FR_CANCELTEXT		1L << FRB_CANCELTEXT
#define FR_NEWFONT		1L << FRB_NEWFONT
#define FR_SCREENFONT		1L << FRB_SCREENFONT
#define FR_EXTENDEDSELECT	1L << FRB_EXTENDEDSELECT
#define FR_INVERTLOOK		1L << FRB_INVERTLOOK
#define FR_HIDEWILD		1L << FRB_HIDEWILD
#define FR_NEWLOOK		1L << FRB_NEWLOOK		/* !! */
#define FR_NONEWLOOK		1L << FRB_NONEWLOOK
#define FR_SELECTLIST		1L << FRB_SELECTLIST
#define	FR_SLSHOWNAMES		1L << FRB_SLSHOWNAMES		/* !! */
#define FR_KEEPBUFFERS		1L << FRB_KEEPBUFFERS
#define FR_EXTRABUTTONS		1L << FRB_EXTRABUTTONS
#define FR_SELECTLISTTIME	1L << FRB_SELECTLISTTIME
#define FR_DIRSONLY		1L << FRB_DIRSONLY
#define FR_USEPENS		1L << FRB_USEPENS

#define	FR_SPECIAL2		1L << FRB_SPECIAL2
#define	FR_SPECIAL1		1L << FRB_SPECIAL1
#define	FR_INUSE		1L << FRB_INUSE

/*  Flags marked with !! above can be changed by the FR */

#define FR_STDFLAGS (FR_AUTOPOSITION|FR_AUTOSIZE|FR_NOINFO|FR_SCREENFONT|FR_HIDEWILD)

struct FileList {	/* Structure for returned multiple select */
 struct FileList *next;	/* Pointer to next FileList structure */ 
 LONG   private;	/* private -- do not use */
 LONG   FileSize;	/* File size  */
 LONG   FileDate;	/* Date stamp (in days since 1978) */
 USHORT FileTime;	/* Time stamp (in minutes since midnight) */
 UBYTE  FileProtection;	/* Protection flags */
 UBYTE  FileFlags;	/* Special file flags */
 UBYTE  FileName[32];	/* The file name itself */
 };

			/* return codes for ExtraButton callback function */

#define EB_CONTINUE	0	/* FR just continues */
#define EB_OK		1	/* FR is OK'd and exits immediately */
#define EB_CANCEL	2	/* FR is cancelled and exits immediately */

struct ExtraButton {
 struct ExtraButton *next;	/* pointer to next button */
 ULONG  flags;			/* flags to define button */
 ULONG  (*button_function)(struct ExtraButton *);
				/* function to be called when button is hit */
 UBYTE  *text;			/* actual text of button, up to 10 chars */
 UBYTE  *help1, *help2, *help3; /* pointers to help lines */
 VOID	*UserData;		/* for your use... */
 struct Window *window;		/* current FR window.. read only. */
 };

struct ExtraData {
 struct Image *UpArrow;		/* replacement image for Up Arrow */
 struct Image *DnArrow;		/* replacement image for Down Arrow */
 struct Image *DiskNormal;	/* replacement image for Disks */
 struct Image *DiskSelected;	/* replacement select image for Disks */

				/* NO LONGER VALID... DO NOT USE */
 struct Image *SizeStrip;	/* replacement image for Size gadgets */

 UBYTE	*oktext;		/* text to be used as OK text */
 UBYTE	*canceltext;		/* text to be used as CANCEL text */
 USHORT	LeftEdge,TopEdge,Width,Height;

 struct	TextAttr *NewFont;	/* New font to use instead of Topaz 8 */	

				/* THIS IS NOW OBSOLETE.. USE NextSelect() */
 struct	FileList *ExtendedList;	/* Always set to NULL at first call.  */
				/* If FR_EXTENDEDSELECT is set, this will */
				/* return a linked list of FileList structs. */
				/* WARNING!  DO NOT USE THIS ANYMORE... */
				/* I MIGHT REMOVE IT FOR RELEASE 4. */

 UBYTE	*Hide;			/* Hide wildcard pattern */

 UBYTE	*SelectList;		/* Pointer to the internal Select List */
 UBYTE	*NextEntry;		/* Pointer to next entry, used by NextSelectEntry() */
 ULONG  SelectListSize;		/* Size of SelectList.. in bytes */

 UBYTE	*buffer;		/* private storage for temp stuff */
 struct ExtraButton *button;	/* pointer to additional button, if exists */

 UBYTE  pen0;			/* shadow pen */
 UBYTE  pen1;			/* text pen  - file names */
 UBYTE  pen2;			/* text2 pen - titles and info */
 UBYTE  pen3;			/* text3 pen - directories */

 ULONG	unused[2];		/* for future expansion.  Always set to NULL */
 };

				/* Use this structure for the NewFReq() call */
				/* This allows you to call the FR with just */
struct FRequest {		/* one argument, a struct FRequest */
 struct Screen *screen;		/* Pointer to a screen structure */
 UBYTE *reqtitle;		/* Pointer to title text */
 UBYTE *filename;		/* Pointer to the filename buffer */
 UBYTE *directory;		/* Pointer to the directory buffer */
 UBYTE *fullname;		/* Pointer to the full path to the file */
 UBYTE *pattern;		/* Pointer to the pattern buffer */
 ULONG flags;			/* FR flags */
 struct ExtraData *extras;	/* pointer to an ExtraData struct */
 };

/*                   Copyright 1990-1992  Khalid Aldoseri.                   */
