/* ======================================================================== *
					yfunctions.h - prototypes for y.lib
							       By Talin.
				Compiled under Manx 5.0 with large code/data
 * ======================================================================== */

struct impDraw;

	/* resident-able replacement for cli_parse() */
LONG _xcli_parse(struct Process *,char *,long,char *,long,char **,long);

	/* Easy wrapper function for Examine that gets real file name */
LONG GetLockName(BPTR lock,char *buffer,LONG length);

	/* used for layout, gets string lengths for array of text */
int ArrayTextLength(char **, UWORD *, int, struct TextFont *);

	/* used for button layout */
int CalcTotalSpace(UWORD *, int, int, int, int, int);

	/* used for button layout */
int ArrangeSpacing(int, UWORD *, UWORD *, int, int, int, int, int, int);

	/* break up string delimited by '|' or CR into smaller strings */
int BreakString(char *text, char *array[], int maxstrings);

	/* count nodes in a list */
LONG CountNodes(struct MinList *list);

	/* sort of an "OpenWindowSafetly" -- handles multiple windows on same port */
void InstallWindowPort(struct Window *w,LONG idcmpflags,struct MsgPort *userport);

	/* my version of CloseWindowSafely() */
void CloseWindowSafely(struct Window *win);

	/* get the visible area of a virtual (or normal) screen */
void GetDClip(struct Screen *s, struct IBox *result);

	/* draw bevel box, quickly */
void ThinBevel(struct RastPort *rp, struct IBox *, LONG, LONG);

	/* draw bevel box with thicker sides */
void QuickBevel(struct RastPort *rp, struct IBox *, LONG, LONG);

	/* give it a screen pointer and it fill in the pubname */
void GetPubScreenName (struct Screen * scr, char *buffer, int maxlen);

	/* safe rectfill with relative width and height (and mac-style pixel math) */
void PaintRect(struct RastPort *rp,SHORT x, SHORT y, SHORT w, SHORT h);

	/* safe rectfill with relative width and height (and mac-style pixel math) */
void PaintIBox(struct RastPort *rp, struct IBox *b);
#pragma regcall( PaintIBox(a1,a0) )

	/* 	Fill in an IBox with the specified coordinates */
struct IBox *SetRect(struct IBox *b, WORD top, WORD left, WORD width, WORD height);

	/* determine if a point is inside of an IBox */
BOOL PtInRect(struct IBox *b,SHORT x, SHORT y);
#pragma regcall( PtInRect(a1,d0,d1) )

	/* expand or shrink an IBox on all sides, and return IBox address */
struct IBox *ExpandIBox(struct IBox *b, int dx, int dy);
#pragma regcall( ExpandIBox(a1,d0,d1) )

	/* 	Constrain the size and position of a rectangle to fit inside another one */
struct IBox *RectFit(struct IBox *outer, struct IBox *inner,struct IBox *result);
#pragma regcall( RectFit(a0,a1,a2) )

	/* 	Adjust rectangle to have positive width and height, and return address */
struct IBox *NormalizeRect(struct IBox *b);
#pragma regcall( NormalizeRect(a0) )

	/* 	Surround two rectangles with a larger rectangle, and return result */
struct IBox *UnionRect(struct IBox *a, struct IBox *b, struct IBox *c);
#pragma regcall( UnionRect(a0,a1,a2) )

	/* 	Calculate the intersection of two rectangles (return TRUE if any) */
BOOL SectRect(struct IBox *a, struct IBox *b, struct IBox *c);
#pragma regcall( SectRect(a0,a1,a2) )

	/* 	Constrain the size and position of a rectangle to fit inside another one */
BOOL RectOverlap(struct IBox *a, struct IBox *b);
#pragma regcall( RectOverlap(a0,a1) )

	/* compute window-relative box for gadgets */
void SetupGadgetBox(struct Gadget *gadget,struct IBox *domain, struct IBox *box);

	/* compute gadget-relative box for image classes */
void SetupImageIBox(struct IBox *box, struct Image *img, struct impDraw *msg);

	/* case insensitive substring finder */
char *str_subi(char *str1,char *str2);

	/* write text to clipboard */
int WriteClipText(char *text, int length);

	/* read text from clipboard */
int ReadClipText(char *text, int maxlength);

	/* taken from alib -- boopsi dispatch functions */
ULONG DoMethodA( Object *obj, Msg *message );
ULONG DoMethod( Object *obj, unsigned long MethodID, ... );
ULONG DoSuperMethodA( struct IClass *cl, Object *obj, Msg *message );
ULONG DoSuperMethod( struct IClass *cl, Object *obj, unsigned long MethodID, ... );

	/* convert a 2.0 Screen Mode name into a Mode ID # */
LONG GetModeIDByName(char *name);

	/* Call a Hook function */
int HookCall(struct Hook *hook,long *msg,void *params);
#pragma regcall( HookCall(a0,a1,a2) )
