[comp.sources.amiga] v02i080: gimme.lib - misc library routines, Part07/07

page@swan.ulowell.edu (Bob Page) (12/02/88)

Submitted-by: oscvax!jan@uunet.UU.NET (Jan Sven Trabandt)
Posting-number: Volume 2, Issue 80
Archive-name: libraries/gimme.7

#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
#----cut here-----cut here-----cut here-----cut here----#
#!/bin/sh
# shar:    Shell Archiver
#	Run the following text with /bin/sh to create:
#	bitplane.h
#	color.h
#	communic.h
#	copystuff.h
#	debug.h
#	gadget.h
#	gimNOshortdefs.h
#	gimmeall.h
#	gimmefuncs.h
#	gimshortdefs.h
#	globals.h
#	graph.h
#	intuistuff.h
#	macros.h
#	menustuff.h
#	minterm.h
#	picture.h
#	postext.h
#	requester.h
#	scrollbar.h
#	sound.h
#	stdstuff.h
#	window.h
# This archive created: Thu Dec  1 19:30:07 1988
cat << \SHAR_EOF > bitplane.h
#ifndef GIMMELIB_BITPLANE_H
#define GIMMELIB_BITPLANE_H

/* flags for gimmeBitPlanes() */
#define GBP_SEPARATE		(1L << 0)       /* separate bitplanes */
#define GBP_CONTIGUOUS		(1L << 1)       /* make bitplanes contiguous */
/* default (can be 0L too): try contiguous first, then separate */
#define GBP_DEFAULT		(GPIC_CONTIGUOUS | GPIC_SEPARATE)
/* error return flag */
#define GBP_ERROR		0xFF000000L	/* unable to get planes */

#endif !GIMMELIB_BITPLANE_H
SHAR_EOF
cat << \SHAR_EOF > color.h
#ifndef GIMMELIB_COLOR_H
#define GIMMELIB_COLOR_H

#define DFLT_MAX_COLORS    16

#ifdef I_AM_COLOR
static USHORT gimColorTable[DFLT_MAX_COLORS] = {
    0x002, 0xaaa, 0x900, 0x039,
    0x2c2, 0xbb0, 0x0ff, 0xf0f,
    0x620, 0xe50, 0x9f1, 0xeb0,
    0x92f, 0x55f, 0x0f8, 0xeee
  };
#endif I_AM_COLOR

#define GIM_BACKGROUND	0

#define GIM_BLACK	0
#define GIM_WHITE	1
#define GIM_RED 	2
#define GIM_BLUE	3

#define GIM_GREEN	4
#define GIM_YELLOW	5
#define GIM_CYAN	6
#define GIM_MAGENTA	7

#define GIM_DRED	8
#define GIM_ORANGE	9
#define GIM_LGREEN	10
#define GIM_MUSTARD	11
#define GIM_PURPLE	12
#define GIM_LBLUE	13
#define GIM_MINT	14
#define GIM_LWHITE	15

#endif !GIMMELIB_COLOR_H
SHAR_EOF
cat << \SHAR_EOF > communic.h
#ifndef GIMMELIB_COMMUNIC_H
#define GIMMELIB_COMMUNIC_H


#ifdef I_AM_COMMUNIC
/* internal constants */
#ifndef MILLION
#define MILLION 	1000000L
#endif
#define SMALL_SECS	0L		/* "small" time-out */
#define SMALL_MICROS	(MILLION / 2)
#define BIG_SECS	2L		/* "large" time-out */
#define BIG_MICROS	0L

#define DEFAULT_EOL	0x0d	    /* CR */
#endif I_AM_COMMUNIC


/* Constants used for setup parameters */
#define C_SER_7 	1	/* 7 wire handshaking */
#define C_SER_3 	2	/* 3 wire XON/XOFF handshaking */

#define C_NO_PARITY	1	/* No parity */
#define C_EVEN_PARITY	2	/* Even parity */
#define C_ODD_PARITY	3	/* Odd parity */

/* Setup parameter structure */
typedef struct c_parameters {
    WORD C_MODE;		/* Mode of communications to be used */
    WORD C_BAUD;
    WORD C_STOP;
    WORD C_PARITY;
    WORD C_RLEN;
    WORD C_WLEN;
} SERPARMS;

/* Error Condition values */
#define C_ERR_OK	0	/* No error occured */
#define C_ERR_INITIAL	1	/* System not initialized */
#define C_ERR_OPEN	2	/* Channel already opened */
#define C_ERR_CANT	3	/* Can't open channel */
#define C_ERR_PARAMS	4	/* Can't set parameters as specified */
#define C_ERR_CHAN	5	/* Channel not open */
#define C_ERR_GET	6	/* Timeout before character recieved */
#define C_ERR_PUT	7	/* Can't send character */
#define C_ERR_PARITY	8	/* Parity specified is not valid */
#define C_ERR_ILLEGAL	9	/* Illegal length parameter for get/put s */
#define C_ERR_BADPARM	10	/* Invalid parameter given to routine */

#ifndef I_AM_COMMUNIC
extern short c_error;		/* error number of last communic routine */
#endif !I_AM_COMMUNIC

#endif !GIMMELIB_COMMUNIC_H
SHAR_EOF
cat << \SHAR_EOF > copystuff.h
#ifndef GIMMELIB_COPYSTUFF_H
#define GIMMELIB_COPYSTUFF_H

/* flags for various copy routines */
#define GCP_NOT_ITEXT	(1L << 1)       /* don't copy IntuiText struct(s) */
#define GCP_NOT_IMAGE	(1L << 2)       /* don't copy Image struct(s) */
#define GCP_NOT_STRING	(1L << 8)       /* don't copy actual string */
#define GCP_NOT_BYTES	(1L << 9)       /* don't copy (image) byte data */
#define GCP_NOT_POINTS	(1L << 10)      /* don't copy (border) points data */
#define GCP_NOT_TEXTATTR  (1L << 11)    /* don't copy (itext) textattr */

#define GCP_NOT_STRUCTS (0x000ffL)      /* don't copy "sub-structures" */
#define GCP_NOT_DATA	(0x0ff00L)      /* don't copy "low-level" data */

#define GCP_SALVAGE	(1L << 16)      /* try to copy as much as possible */
#define GCP_DEFAULT	(0L)            /* copy everything */


#endif !GIMMELIB_COPYSTUFF_H
SHAR_EOF
cat << \SHAR_EOF > debug.h
#ifndef GIMMELIB_DEBUG_H
#define GIMMELIB_DEBUG_H

#ifdef DEBUG

#define DEBUGCMD(c) c
#define DEBUGMSG(c) printf(c)
#define DEBUGMSG1(c,p) printf(c,p)
#define DEBUGMSG2(c,p1,p2) printf(c,p1,p2)
#define DEBUGMSG3(c,p1,p2,p3) printf(c,p1,p2,p3)
#define DEBUGMSG4(c,p1,p2,p3,p4) printf(c,p1,p2,p3,p4)

#ifndef OWNDEBUG
/* doPrintf parms: process-port, reply-port, c, p1, p2, p3, p4
 * note regarding reply-port: if it is NULL, then the printf might not get
 * done before a crash since doPrintf will not wait for a reply to make
 * sure that the printf was done
 * THIS VERSION uses gimMainPort as a default port, so it had better be there!!
*/
/* subtask debug message */
#define STDEBUGMSG(c) doPrintf(gimMainPort,NULL,c,0,0,0,0)
#define STDEBUGMSG1(c,p) doPrintf(gimMainPort,NULL,c,p,0,0,0)
#define STDEBUGMSG2(c,p1,p2) doPrintf(gimMainPort,NULL,c,p1,p2,0,0,0)
#define STDEBUGMSG3(c,p1,p2,p3) doPrintf(gimMainPort,NULL,c,p1,p2,p3,0)
#define STDEBUGMSG4(c,p1,p2,p3,p4) doPrintf(gimMainPort,NULL,c,p1,p2,p3,p4)
#endif !OWNDEBUG

#else

#define DEBUGCMD(c)
#define DEBUGMSG(c)
#define DEBUGMSG1(c,p)
#define DEBUGMSG2(c,p1,p2)
#define DEBUGMSG3(c,p1,p2,p3)
#define DEBUGMSG4(c,p1,p2,p3,p4)

#define STDEBUGMSG(c)
#define STDEBUGMSG1(c,p)
#define STDEBUGMSG2(c,p1,p2)
#define STDEBUGMSG3(c,p1,p2,p3)
#define STDEBUGMSG4(c,p1,p2,p3,p4)

#endif else !DEBUG

#endif !GIMMELIB_DEBUG_H
SHAR_EOF
cat << \SHAR_EOF > gadget.h
#ifndef GIMMELIB_GADGET_H
#define GIMMELIB_GADGET_H

#include "gimmelib/postext.h"

/***
    flags for gimmeBoolGadget()
    ==> see flags for positionText() in <gimmelib/postext.h>
    NOTE: the default flags are as follows (use the appropriate flags or 0L):
	    x : left
	    y : top
***/

#ifdef I_AM_GADGET
/* internal spacing for gadgets */
#define HORIZ_SPACE	5
#define VERT_SPACE	2
#define AROUND_SPACE	1
#endif I_AM_GADGET

/* size of string gadget's undo buffer */
#define GIM_DFLT_UNDO_BUF_SIZE	    81

#endif !GIMMELIB_GADGET_H
SHAR_EOF
cat << \SHAR_EOF > gimNOshortdefs.h
#ifndef GIMMELIB_NO_SHORT_DEFS_H
#define GIMMELIB_NO_SHORT_DEFS_H

#ifdef GIMMELIB_SHORT_DEFS_H
#undef SCREEN
#undef WINDOW
#undef NEWSCREEN
#undef NEWWINDOW
#undef BITMAP
#undef RASTPORT
#undef TEXTATTR
#undef REQUESTER
#undef GADGET
#undef BORDER
#undef STRINGINFO
#undef PROPINFO
#undef IMSG
#undef ITEXT
#undef IMAGE
#undef MSGPORT
#undef MESSAGE
#undef TASK
#undef RASINFO
#undef TEXTFONT
#undef TIMEVAL
#undef TIMEREQ
#undef CPRLIST
#undef AREAINFO
#undef TMPRAS
#undef IOREQUEST
#undef IOSTDREQ
#undef MENU
#undef MENUITEM
#undef GIMMELIB_SHORT_DEFS_H
#endif GIMMELIB_SHORT_DEFS_H

#endif !GIMMELIB_NO_SHORT_DEFS_H
SHAR_EOF
cat << \SHAR_EOF > gimmeall.h
#ifndef GIMMELIB_ALL_H
#define GIMMELIB_ALL_H

#include "gimmelib/gimmefuncs.h"
/* #include "gimmelib/gimshortdefs.h" */
/* #include "gimmelib/gimeNOshortdefs.h" */
/* #include "gimmelib/macros.h" */
/* #include "gimmelib/debug.h" */

#include "gimmelib/bitplane.h"
#include "gimmelib/color.h"
#include "gimmelib/communic.h"
#include "gimmelib/copystuff.h"
#include "gimmelib/gadget.h"
#include "gimmelib/globals.h"
#include "gimmelib/graph.h"
#include "gimmelib/intuistuff.h"
#include "gimmelib/menustuff.h"
#include "gimmelib/minterm.h"
#include "gimmelib/picture.h"
#include "gimmelib/postext.h"
#include "gimmelib/requester.h"
#include "gimmelib/scrollbar.h"
#include "gimmelib/sound.h"
#include "gimmelib/stdstuff.h"
#include "gimmelib/window.h"

#endif !GIMMELIB_ALL_H
SHAR_EOF
cat << \SHAR_EOF > gimmefuncs.h
#ifndef GIMMELIB_FUNCTIONS_H
#define GIMMELIB_FUNCTIONS_H

#include <exec/types.h>
#include <intuition/intuition.h>
#include <exec/memory.h>
#ifdef AZTEC_C
#include <functions.h>
#endif AZTEC_C

/* short defines for system structs used below */
#include "gimmelib/gimshortdefs.h"

/* these ones have custom structs */
#include "gimmelib/sound.h"
#include "gimmelib/picture.h"
#include "gimmelib/graph.h"
#include "gimmelib/communic.h"


/* bitmap.c */
BITMAP *    gimmeBitMap(/*  SHORT depth, SHORT width, SHORT height  */);
short	    getRidOfBitMap(/*  BITMAP*  */);

/* bitplane.c (bitplane.h) */
ULONG	    gimmeBitPlanes(/*  BITMAP*, ULONG myflags  */);
short	    getRidOfBitPlanes(/*  BITMAP*, ULONG myflags  */);

/* color.c (color.h) */
USHORT *    getDefaultColors();
short	    setColors(/*  SCREEN*, USHORT* ctable, SHORT colors  */);
short	    checkColors(/*  SCREEN*, SHORT colors */);

/* communic.c (communic.h) */
short	    c_init();
short	    c_done();
short	    c_open(/*  SERPARMS*  */);
short	    c_setup(/*  SERPARMS*  */);
short	    c_close();
short	    c_emptyc();
short	    c_getc(/*  char*  */);
short	    c_gets(/*  char*, SHORT num  */);
short	    c_getline(/*  char*, SHORT num  */);
short	    c_setEOL(/*  char  */);
short	    c_putc(/*  char  */);
short	    c_puts(/*  char*, SHORT num  */);

/* copystuff.c (copystuff.h) */
BORDER *    copyBorder(/*  void** memheadptr, BORDER*, SHORT numbord,
				ULONG myflags  */);
IMAGE *     copyImage(/*  void** memheadptr, IMAGE*, SHORT numimage,
				ULONG myflags  */);
short	    copyDataImage(/*  USHORT* srcdata, IMAGE*  */);
short	    copyImageData(/*  IMAGE*, USHORT* destdata  */);
ITEXT *     copyIntuiText(/*  void** memheadptr, ITEXT*, SHORT numitext,
				ULONG myflags  */);
MENU *	    copyMenu(/*  void** memheadptr, MENU*, SHORT nummenu, SHORT numitem,
				SHORT numsub, ULONG myflags  */);
MENUITEM *  copyMenuItem(/*  void** memheadptr, MENU*, SHORT numitem,
				SHORT numsub, ULONG myflags  */);

/* dbuf.c (minterm.h) */
short	    makeDBuf(/*  SCREEN*, BITMAP** bmptr  */);
short	    unmakeDBuf(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
short	    swapDBuf(/*  SCREEN*, SHORT minterm  */);

/* dbufquick.c (minterm.h) */
short	    makeDBufQuick(/*  SCREEN*, BITMAP** bmptr, CPRLIST** lcpr,
				CPRLIST** scpr	*/);
short	    unmakeDBufQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*,
				CPRLIST** lcpr, CPRLIST** scpr	*/);
short	    swapDBufQuick(/*  SCREEN*, SHORT minterm, CPRLIST** lcpr,
				CPRLIST** scpr	*/);

/* dbufvquick.c (minterm.h) */
short	    makeDBufVQuick(/*  SCREEN*, BITMAP** bmptr  */);
short	    unmakeDBufVQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
short	    swapDBufVQuick(/*  SCREEN*, SHORT minterm  */);

/* dualpf.c */
short	    makeDualPlayfield(/*  SCREEN*, RASINFO*, SHORT depth  */);
short	    unmakeDualPlayfield(/*  SCREEN*  */);

/* font.c */
TEXTFONT *  gimmeFont(/*  TEXTATTR*  */);
TEXTFONT *  gimmeFontLazy(/*  UBYTE *name, UWORD size  */);
short	    getRidOfFont(/*  TEXTFONT*  */);

/* gadget.c (gadget.h) */
GADGET *    gimmeBoolGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT xsize, SHORT ysize, UBYTE* s, UBYTE* s2,
				TEXTATTR*, ULONG myflags  */);
GADGET *    gimmeBoolImageGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT depth, SHORT width, SHORT height,
				ULONG myflags, SHORT dep2, SHORT wid2,
				SHORT ht2  */);
GADGET *    gimmePropGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT xsize, SHORT ysize, UBYTE* label,
			       TEXTATTR*, ULONG activflags, ULONG propflags  */);
PROPINFO *  gimmePropInfo(/*  void** memheadptr, ULONG flags  */);
GADGET *    gimmeStringGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT width, SHORT maxbuf, UBYTE* initstr,
				UBYTE* label, TEXTATTR*, ULONG activflags  */);
STRINGINFO *gimmeStringInfo(/*  void** memheadptr, SHORT bufsize, UBYTE *s,
				ULONG flags  */);
short	    getRidOfGadgets(/*  GADGET* firstgadget  */);

/* gadgstuff.c */
short	    clearGadgets(/*  GADGET* firstgadget, WINDOW*, REQUESTER*,
				SHORT numgad  */);
short	    toggleBoolGadget(/*  WINDOW*, GADGET*, REQUESTER*  */);
GADGET *    findGadget(/*  GADGET*, USHORT id  */);
GADGET *    findMyFirstGadget(/*  WINDOW*, USHORT id  */);

/* graph.c (graph.h) */
GRAPH *     gimmeGraph(/*  NEWGRAPH*, BITMAP*, AREAINFO*, TMPRAS*  */);
short	    getRidOfGraph(/*  GRAPH*  */);
VOID	    clearGraph(/*  GRAPH*  */);
VOID	    resetGraph(/*  GRAPH*  */);
VOID	    drawGraphAxesOnly(/*  GRAPH*  */);
SHORT	    drawGraphAxes(/*  GRAPH*  */);
VOID	    drawGraphTitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
VOID	    drawGraphXtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
VOID	    drawGraphYtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
SHORT	    graphWriteLabel(/*  GRAPH*, ULONG myflags, SHORT first, SHORT last,
				SHORT step  */);
VOID	    addToGraph(/*  GRAPH*, x, y  */);

/* inputhand.c */
IOSTDREQ *  addInputHandler(/*  void (*handler)(), APTR data, BYTE pri,
				UBYTE* name  */);
short	    removeInputHandler(/*  IOSTDREQ*  */);

/* intuistuff.c */
BORDER *    gimmeBorder(/*  void** memheadptr, SHORT xsize, SHORT ysize  */);
IMAGE *     gimmeImage(/*  void** memheadptr, SHORT depth, SHORT width,
				SHORT height  */);
ITEXT *     gimmeIntuiText(/*  void** memheadptr, UBYTE *s, TEXTATTR*,
				SHORT optwidth	*/);

/* keyboard.c */
SHORT	    deadKeyConvert(/*  IMSG, UBYTE* buf, USHORT size, KEYMAP*  */);

/* menu.c */
MENU *	    gimmeMenu(/*  void** memheadptr, SHORT left, SHORT width,
				UBYTE* name, ULONG flags  */);
MENUITEM *  gimmeMenuItem(/*  void** memheadptr, SHORT left, SHORT width,
				SHORT height, BYTE command, UBYTE* name,
				TEXTATTR* textattr, ULONG flags  */);

/* menustuff.c (menustuff.h) */
ULONG	    addMenuItem(/*  MENU*, MENUITEM*, SHORT positem, SHORT possub,
				SHORT numitem, ULONG myflags  */);
MENUITEM *  removeMenuItem(/*  MENU *, MENUITEM*, SHORT positem, SHORT possub,
				SHORT numitem, ULONG myflags  */);
ULONG	    addMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
				SHORT nummenu, ULONG myflags  */);
MENU *	    removeMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
				SHORT nummenu, ULONG myflags  */);
short	    adjustMenuLefts(/*  MENU* menu, MENU* stop, SHORT leftedge,
				ULONG myflags  */);
short	    adjustMenuItems(/*  ITEM* item, ITEM* stop, SHORT topedge,
				SHORT meposition, ULONG myflags  */);

/* memchain.c */
void *	    chainAllocMem(/*  void** memheadptr, ULONG size, ULONG flags  */);
VOID	    chainFreeMem(/*  void* memhead  */);
short	    linkChainMem(/*  void** memheadptr, void* memhead  */);
short	    pluckChainMem(/*  void** memheadptr, void* memory  */);

/* message.c */
MESSAGE *   gimmeMessage(/*  ULONG size, MSGPORT*  */);
short	    getRidOfMessage(/*  MESSAGE*  */);

/* picture.c (picture.h) */
PICTURE *   gimmePicture(/*  UBYTE* filename, ULONG myflags  */);
short	    getRidOfPicture(/*  PICTURE*  */);
short	    positionPicture(/*  RASTPORT*, ULONG myflags, PICTURE*,
				SHORT minterm, SHORT x, SHORT y  */);
short	    usePictureColors(/*  PICTURE*, SCREEN*  */);

/* postext.c (postext.h) */
SHORT	    positionText(/*  RASTPORT*, ULONG myflags, UBYTE* s, LONG num,
				SHORT x, SHORT y  */);

/* requester.c (requester.h) */
SHORT	    gimmeAutoRequest(/*  WINDOW*, UBYTE* string, TEXTATTR*  */);
REQUESTER * gimmeRequester(/*  void** memheadptr, SHORT left, SHORT top,
			SHORT width, SHORT height, UBYTE backfill,
			GADGET* gplist, UBYTE *s, TEXTATTR*, ULONG flags  */);

/* screen.c */
NEWSCREEN * gimmeNewScreen(/*  ULONG modes, ULONG type, SHORT depth,
				UBYTE* title, TEXTATTR*  */);
short	    getRidOfNewScreen(/*  NEWSCREEN*  */);
SCREEN *    gimmeScreen(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth,
				ULONG IDCMPflags, ULONG winflags  */);
SCREEN *    gimmeScreenLazy(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth  */);
short	    getRidOfScreen(/*  SCREEN*, WINDOW*  */);
short	    lowerScreen(/*  SCREEN*, SHORT toheight  */);
short	    raiseScreen(/*  SCREEN*, SHORT toheight  */);

/* scrollbar.c (scrollbar.h) */
GADGET *    gimmeFullScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
				ULONG myflags, USHORT id1, USHORT id2  */);
GADGET *    gimmeScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
				ULONG myflags  */);
GADGET *    gimmeOneScroll(/*  WINDOW*, USHORT id, ULONG dirflags,
				ULONG myflags  */);

/* sound.c (sound.h) */
SOUND *     gimmeSound(/*  UBYTE* filename  */);
short	    getRidOfSound(/*  SOUND*  */);

/* stdstuff.c (stdstuff.h) */
ULONG	    gimmeStdStuff(/*  ULONG myflags, SHORT rev  */);
ULONG	    getRidOfStdStuff(/*  ULONG myflags  */);

/* subtinit.c */
short	    initSubTasker(/*  SHORT*, MSGPORT**  */);
short	    doneSubTasker(/*  SHORT*, MSGPORT**  */);
SHORT	    handleSpecialSubTaskMsg(/*  SHORT*, MSGPORT**  */);
short	    doPrintf(/*  MSGPORT* dosport, MSGPORT* replyport, UBYTE* s,
				LONG p1, LONG p2, double p3, double p4	*/);

/* subtask.c */
TASK *	    gimmeSubTask(/*  SHORT*, MSGPORT**, LONG stacksize, LONG datasize,
				MSGPORT** myportptr  */);
VOID	    undoGimmeSubTask(/*  TASK*  */);
short	    startSubTask(/*  TASK*, char* name, BYTE pri,
				void (*initialpc)(), void (*finalpc)()  */);
VOID	    killSubTask(/*  SHORT*, MSGPORT**, TASK*  */);

/* timer.c */
TIMEREQ *   accessTimer(/*  ULONG unit, MSGPORT** msgportptr  */);
LONG	    releaseTimer(/*  TIMEREQ* master, MSGPORT* saveport  */);
TIMEREQ *   gimmeTimeRequest(/*  TIMEREQ* master  */);
LONG	    getRidOfTimeRequest(/*  TIMEREQ* slave  */);

/* timerstuff.c */
LONG	    timeDelay(/*  ULONG secs, ULONG micros, ULONG unit, TIMEREQ*  */);
TIMEREQ *   timeDelayAsync(/*  ULONG secs, ULONG micros, ULONG unit,
				TIMEREQ*  */);
LONG	    waitTimer(/*  TIMEREQ*  */);
LONG	    killTimeDelay(/*  TIMEREQ*  */);
short	    getSysTime(/*  ULONG* secsptr, ULONG* microsptr, TIMEREQ*  */);
short	    setSysTime(/*  ULONG secs, ULONG micros, TIMEREQ*  */);

/* window.c (window.h) */
NEWWINDOW * gimmeNewWindow(/*  UBYTE* title, SCREEN*, SHORT left, SHORT top,
			    ULONG IDCMPflags, ULONG flags  */);
short	    getRidOfNewWindow(/*  NEWWINDOW*  */);
WINDOW *    gimmeWindow(/*  NEWWINDOW*, SHORT depth, SHORT width,
			    SHORT height  */);
short	    getRidOfWindow(/*  WINDOW*  */);

/* undefine the gimshortdefs.h defines to avoid possible redefined symbols */
#include "gimmelib/gimNOshortdefs.h"

#endif !GIMMELIB_FUNCTIONS_H
SHAR_EOF
cat << \SHAR_EOF > gimshortdefs.h
#ifndef GIMMELIB_SHORT_DEFS_H
#define GIMMELIB_SHORT_DEFS_H

/* some short-form defines
 * (should be typedefs, but then you can't undefine them)
#define SCREEN	    struct Screen
#define WINDOW	    struct Window
#define NEWSCREEN   struct NewScreen
#define NEWWINDOW   struct NewWindow
#define BITMAP	    struct BitMap
#define RASTPORT    struct RastPort
#define TEXTATTR    struct TextAttr
#define REQUESTER   struct Requester
#define GADGET	    struct Gadget
#define BORDER	    struct Border
#define STRINGINFO  struct StringInfo
#define PROPINFO    struct PropInfo
#define IMSG	    struct IntuiMessage
#define ITEXT	    struct IntuiText
#define IMAGE	    struct Image
#define MSGPORT     struct MsgPort
#define MESSAGE     struct Message
#define TASK	    struct Task
#define RASINFO     struct RasInfo
#define TEXTFONT    struct TextFont
#define TIMEVAL     struct timeval
#define TIMEREQ     struct timerequest
#define CPRLIST     struct cprlist
#define AREAINFO    struct AreaInfo
#define TMPRAS	    struct TmpRas
#define IOREQUEST   struct IORequest
#define IOSTDREQ    struct IOStdReq
#define MENU	    struct Menu
#define MENUITEM    struct MenuItem
#ifdef GIMMELIB_NO_SHORT_DEFS_H
#undef GIMMELIB_NO_SHORT_DEFS_H
#endif GIMMELIB_NO_SHORT_DEFS_H

#endif !GIMMELIB_SHORT_DEFS_H
SHAR_EOF
cat << \SHAR_EOF > globals.h
#ifndef GIMMELIB_GIM_GLOBALS_H
#define GIMMELIB_GIM_GLOBALS_H

#ifndef I_AM_GIM_GLOBALS
extern struct TextAttr gimMyFont;	/* topaz 80 font */

extern UBYTE *gimAutReqPostext;
extern UBYTE *gimAutReqNegtext;

extern USHORT gimDataOneScrollUp[];
extern USHORT gimDataOneScrollDown[];
extern USHORT gimDataOneScrollLeft[];
extern USHORT gimDataOneScrollRight[];
#endif !I_AM_GIM_GLOBALS

#endif !GIMMELIB_GIM_GLOBALS_H
SHAR_EOF
cat << \SHAR_EOF > graph.h
#ifndef GIMMELIB_GRAPH_H
#define GIMMELIB_GRAPH_H

#include "gimmelib/postext.h"


typedef struct _gim_nax {
    SHORT origin, size;     /* offset of origin and axis size in pixels */
    SHORT low;		    /* coord corresponding to origin */
    SHORT amt;		    /* modified by newgraph flags */
    SHORT initpt;	    /* coord of initial point (see newgraph flags) */
    SHORT step; 	    /* step size for even labelling, 0 for fancy */
    SHORT labnum, labdenom; /* fraction for label scaling */
} NEWAXIS;

typedef struct _gim_axis {
    SHORT origin, size;     /* offset of origin and axis size in pixels */
    SHORT low;		    /* coord corresponding to origin */
    SHORT high; 	    /* coord corresponding to high end of axis */
    SHORT scale;	    /* scale of axis: -ve means coords per pixel */
    SHORT usesize;	    /* actual size of axis used in pixels */
    SHORT lastdata;	    /* last coord added to graph */
    SHORT lastoff;	    /* offset of last coord in pixels */
    SHORT step; 	    /* step size for even labelling, 0 for fancy */
    SHORT labnum, labdenom; /* fraction for label scaling */
    SHORT flow, fhigh;	    /* first low and high - for graph reinit */
    SHORT fdata, foff;	    /* first coord and offset - for graph reinit */
} AXIS;

typedef struct _gim_newgr {
    UBYTE   *title, *xtitle, *ytitle;	    /* graph and axes titles */
    struct TextAttr *titleta, *xta, *yta;   /* text attributes for titles */
    BYTE    FPen, BPen, AxesPen, TitlePen;  /* colours for primary parts */
    ULONG   flags, ctlflags;		    /* all-important flags */
    NEWAXIS X, Y;			    /* actual new-axis structs */
    struct RastPort *rp;		    /* RastPort to be copied, or NULL */
} NEWGRAPH;


/* flags for NEWGRAPH.flags (and GRAPH.flags) */
#define GGR_DELTAX	    (1L << 0)
#define GGR_LINETOX	    (1L << 1)
#define GGR_FILLTOX	    (1L << 2)
#define GGR_BLACKTOX	    (1L << 3)
#define GGR_X_MAX	    (1L << 8)   /* default */
#define GGR_X_INTERVALS     (1L << 9)
#define GGR_X_SPACING	    (1L << 10)  /* auto-spacing based on size */
#define GGR_X_INTEGRAL	    (1L << 11)
#define GGR_X_FLAGS	    0x0000FFFFL

#define GGR_DELTAY	    (1L << 16)
#define GGR_LINETOY	    (1L << 17)
#define GGR_FILLTOY	    (1L << 18)
#define GGR_BLACKTOY	    (1L << 19)
#define GGR_Y_MAX	    (1L << 24)  /* default */
#define GGR_Y_INTERVALS     (1L << 25)
#define GGR_Y_SPACING	    (1L << 26)
#define GGR_Y_INTEGRAL	    (1L << 27)
#define GGR_Y_FLAGS	    0xFFFF0000L

#define GGR_DEFAULT	    0L

/* control flags for NEWGRAPH.ctlflags (and GRAPH.ctlflags) */
#define GGR_INITORIGIN	    (1L << 0)
#define GGR_INITPOINT	    (1L << 1)
#define GGR_NOCLEARSTART    (1L << 8)
#define GGR_NOCONNECTLINE   (1L << 9)
#define GGR_NOLABELS	    (1L << 10)
#define GGR_CLEARONEND	    (1L << 15)
#define GGR_HIRES	    (1L << 24)
#define GGR_INTERLACE	    (1L << 25)

#define GGR_CTL_DEFAULT     0L

/* explanation of drawing flags:
 * DELTA:	coord of new point is relative to coord of previous point
 * LINETO:	draw a line from the point to the respective axis
 * FILLTO:	area fill the trapezoid from previous point to resp. axis
 * BLACKTO:	like LINETO but using background colour (useful with FILLTO)

/* explanation of newaxis-specific flags:
 * MAX: 	newaxis.amt specifies max coord on initial graph
 * INTERVALS:	newaxis.amt specifies difference between low and high coords
 * SPACING:	newaxis.amt specifies the scale to be applied (+ve or -ve)
 * INTEGRAL:	force integer number of pixels/coord or coords/pixel

/* explanation of control flags:
 * INITORIGIN:	    use origin as initial point
 * INITPOINT:	    use point specified in nexaxes as initial point
 *			(otherwise newaxis.initpt is ignored)
 * NOCLEARSTART:    don't clear the rastport when initializing graph
 *			(useful if several graphs on same "rastport")
 * NOLABELS:	    don't draw titles, axes and labels for me ever (I'll do it)
 * NOCONNECTLINE:   don't connect points in graph by a line
 * CLEARONEND:	    clear the graph when doing getRidOfGraph
 * HIRES:	    graph to be displayed on HIRES screen
 * INTERLACE:	    graph to be displayed on INTERLACE screen
 *			(these two are useful for determining aspect ratios)


typedef struct _gim_graph {
    struct RastPort rp; 		/* actual RastPort struct */
    ULONG   flags;			/* flags, as in newgraph */
    ULONG   ctlflags;			/* control flags, as in newgraph */
    UBYTE   *title, *xtitle, *ytitle;	/* graph and axes titles */
    struct TextFont *titletf, *xtf, *ytf;   /* fonts for titles */
    struct TextFont *xlabtf, *ylabtf;	    /* fonts for axes' labels */
    BYTE    FPen, BPen, AxesPen, TitlePen;  /* colours for primary parts */
    BYTE    XlabPen, YlabPen, XtitlePen, YtitlePen;   /* secondary colours */
    SHORT   points;			/* number of points added so far */
    AXIS    X, Y;			/* actual axis structs */
    void    *memhead;			/* memory-chain for this graph */
    struct _gim_graph *next;		 /* link to next graph (future use) */
} GRAPH;


/* INTERNAL scaling factor used by graph routines for intermediate results */
#define SCALE	    6


/* flags for graphWriteLabel() */
#define GWL_XAXIS	(1L << 20)      /* label the x-axis (don't set yaxis) */
#define GWL_YAXIS	(1L << 21)      /* label the y-axis (don't set xaxis) */
#define GWL_CLEAR_ONLY	(1L << 22)      /* clear the previous labels only! */
#define GWL_CLEAR_OLD	(1L << 23)      /* clear previous then draw labels */
#define GWL_RESERVED	(0x000fffffL)   /* reserved for internal use only!! */
#define GWL_DEFAULT	(AWL_YAXIS)


#endif !GIMMELIB_GRAPH_H
SHAR_EOF
cat << \SHAR_EOF > intuistuff.h
#ifndef GIMMELIB_INTUISTUFF_H
#define GIMMELIB_INTUISTUFF_H

/* note the image size IN BYTES returned by this macro is a ULONG */
#define  GIM_IMAGESIZE(depth, width, height)  \
	    ( (ULONG)((width + 15) >> 4) * height * (sizeof(SHORT) * depth) )

#endif !GIMMELIB_INTUISTUFF_H
SHAR_EOF
cat << \SHAR_EOF > macros.h
#ifndef GIMMELIB_MACROS_H
#define GIMMELIB_MACROS_H

#ifdef GIM_BUILTIN
#ifdef AZTEC_C
#define strcpy	_BUILTIN_strcpy
#define strcmp	_BUILTIN_strcmp
#define strlen	_BUILTIN_strlen
#endif AZTEC_C
#endif GIM_BUILTIN


/* WSL-type guess-endguess construct (for internal use only) */
#define GUESS		do {
#define QUIF( cond )    if( cond ) break;
#define ENDGUESS	} while( 0 );

#endif !GIMMELIB_MACROS_H
SHAR_EOF
cat << \SHAR_EOF > menustuff.h
#ifndef GIMMELIB_MENUSTUFF_H
#define GIMMELIB_MENUSTUFF_H

/* flags for various menu routines (mutually exclusive across routines) */

/* note: GMI_APPEAREND and GIM_SHUFFLE do not make much sense together */
#define GMI_ADDSUBITEM	(1L << 1)           /* add this item as a subitem */
#define GMI_FIXUP	(1L << 2)           /* modify new item heights */
#define GMI_SHUFFLE	(1L << 3)           /* modify existing item heights */
#define GMI_APPEAREND	(1L << 4)           /* visually appear at end */
#define GMI_FIXUPME	(1L << 5)           /* modify new mutual excludes */
#define GMI_SHUFFLEME	(1L << 6)           /* modify existing mutual exclude */
#define GMI_REMSUBITEM	(1L << 14)          /* remove this item as a subitem */
#define GMI_ADDRONLY	(1L << 15)          /* just find (sub)item address */

#define GMI_RESERVED	(0xfff00000L)       /* reserved for internal use */

#define GMI_DEFAULT	0L

#endif !GIMMELIB_MENUSTUFF_H
SHAR_EOF
cat << \SHAR_EOF > minterm.h
#ifndef GIMMELIB_MINTERM_H
#define GIMMELIB_MINTERM_H

#define GIM_MINTERM_COPY	0x0c0	/* copy source; ignore dest */
#define GIM_MINTERM_DEST	0x0a0	/* keep dest as is */
#define GIM_MINTERM_CLEAR	0x000	/* clear dest block */
#define GIM_MINTERM_FILL	0x0f0	/* fill dest block */
#define GIM_MINTERM_OR		0x0e0	/* mix source and dest */
#define GIM_MINTERM_MIX 	GIM_MINTERM_OR
#define GIM_MINTERM_UNMIX	0x020	/* remove source pattern from dest */
#define GIM_MINTERM_XOR 	0x060	/* xor source and dest */
#define GIM_MINTERM_INV_SRC	0x030	/* invert source */
#define GIM_MINTERM_INV_DEST	0x030	/* invert dest */

/*  4 important bits in minterm are as follows:
 *	7  6  5  4
 *	|  |  |  -> ~src & ~dest
 *	|  |  ----> ~src &  dest
 *	|  ------->  src & ~dest
 *	---------->  src &  dest
*/

#endif !GIMMELIB_MINTERM_H
SHAR_EOF
cat << \SHAR_EOF > picture.h
#ifndef GIMMELIB_PICTURE_H
#define GIMMELIB_PICTURE_H

#include "gimmelib/bitplane.h"

#ifdef I_AM_PICTURE
#define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
				| ((ULONG)(c)<<8) | (ULONG)(d))
#define EVEN(p)         ((p+1) & ~1)

#define ID_FORM 	Mk('F', 'O', 'R', 'M')
#define ID_ILBM 	Mk('I', 'L', 'B', 'M')
#define ID_BMHD 	Mk('B', 'M', 'H', 'D')
#define ID_CMAP 	Mk('C', 'M', 'A', 'P')
#define ID_DEST 	Mk('D', 'E', 'S', 'T')
#define ID_SPRT 	Mk('S', 'P', 'R', 'T')
#define ID_CAMG 	Mk('C', 'A', 'M', 'G')
#define ID_CRNG 	Mk('C', 'R', 'N', 'G')
#define ID_CCRT 	Mk('C', 'C', 'R', 'T')
#define ID_BODY 	Mk('B', 'O', 'D', 'Y')
#endif I_AM_PICTURE


typedef UBYTE Masking;

#define mskNone 	0
#define mskHasMask	1
#define mskHasTranCol	2
#define mskLasso	3

typedef UBYTE Compression;

#define cmpNone 	0
#define cmpByteRun1	1

typedef struct _gim_bmh {
	UWORD	w,h;			/* raster width, height */
	WORD	x,y;			/* pixel position for this image */
	UBYTE	nPlanes;		/* number of bit planes */
	Masking masking;
	Compression compression;
	UBYTE	pad1;			/* unused */
	UWORD	transparentColour;	/* transparent colour number */
	UBYTE	xAspect, yAspect;	/* pixel aspect, a ratio width:height */
	WORD	pageWidth, pageHeight;	/* source page size in pixels */
} BitMapHeader;

typedef struct {
	UBYTE red,green,blue;
} ColourRegister;

typedef struct {
	ColourRegister *luts;		/* pointer to look up table */
	WORD numLuts;			/* number of luts entries */
} LutTable;

typedef struct {
	WORD x,y;			/* relative coordinates */
} Point2D;

typedef struct {
	UBYTE depth;			/* # of bitplanes in original source */
	UBYTE pad1;			/* unused... put zero here */
	UWORD planePick;		/* how to scatter src into dest */
	UWORD planeOnOff;		/* default bitplane data for above */
	UWORD planeMask;		/* which bitplanes to store into */
} DestMerge;

typedef UWORD SpritePrecedence; 	/* relative precedence, 0 is highest */


typedef struct _gim_pic {
    BitMapHeader    bmh;	/* info for this bitmap */
    SHORT	    xsize;	/* actual width in pixels */
    void	    *memhead;	/* memory-chain allocated for this picture */
    struct BitMap   *bm;	/* pointer to bitmap struct */
    struct ColorMap colormap;	/* actual instance; .ColorTable -> colours */
    ULONG	    myflags;	/* flags about the bitmap */
    struct _gim_pic *next;	/* next picture (for future use) */
} PICTURE;


/***
    flags for gimmePicture()
    ==> see flags for gimmeBitPlanes() in <gimmelib/bitplane.h>
***/

#endif !GIMMELIB_PICTURE_H
SHAR_EOF
cat << \SHAR_EOF > postext.h
#ifndef GIMMELIB_POSTEXT_H
#define GIMMELIB_POSTEXT_H


/*  Flags to be used in the "myflags" parameter to the
 *  positionText() routine, and perhaps other routines.
 *  Choose only one x-flag and only one y-flag and or them together.
#define GPT_XLEFT	(1L << 0)       /* default for positionText() */
#define GPT_XRIGHT	(1L << 1)
#define GPT_XCENTRE	(1L << 2)
#define GPT_XFLAGS	(0x000000FFL)

#define GPT_YTOP	(1L << 8)
#define GPT_YBOTTOM	(1L << 9)
#define GPT_YCENTRE	(1L << 10)
#define GPT_YCENTREBASE (1L << 11)
#define GPT_YBASELINE	(1L << 12)      /* default for positionText() */
#define GPT_YFLAGS	(0x0000FF00L)

/* alternatively you can use the following for defaults */
#define GPT_XDEFAULT	0L
#define GPT_YDEFAULT	0L
#define GPT_DEFAULT	0L		/* easy way to get default x,y pos */

/* special control flags for positionText() */
#define GPT_YUPWARDS	(1L << 16)
#define GPT_YDOWNWARDS	(1L << 17)
#define GPT_XTHICKEN	(1L << 18)

/* special control flags for gimmeBoolGadget() */
#define GPT_FULLWIDTH	(1L << 28)

#define GPT_CTLFLAGS	(0x0FFFF0000L)

#endif !GIMMELIB_POSTEXT_H
SHAR_EOF
cat << \SHAR_EOF > requester.h
#ifndef GIMMELIB_REQUESTER_H
#define GIMMELIB_REQUESTER_H

#ifdef I_AM_REQUESTER
#define GAR_DUMMY_TEXT	    "WHY AM I HERE?"

#define GAR_BORDER_WIDTH    4	    /* number of chars for border width */
#define GAR_HEIGHT	    6	    /* number of char lines */
#endif I_AM_REQUESTER


/* original positive and negative text for gimmeAutoRequest() */
#define GAR_POSTEXT	"YES"
#define GAR_NEGTEXT	"NO"


#ifndef I_AM_GIM_GLOBALS
extern UBYTE *gimAutReqPostext;
extern UBYTE *gimAutReqNegtext;
#endif !I_AM_GIM_GLOBALS

#endif !GIMMELIB_REQUESTER_H
SHAR_EOF
cat << \SHAR_EOF > scrollbar.h
#ifndef GIMMELIB_SCROLLBAR_H
#define GIMMELIB_SCROLLBAR_H

/* flags for gimmeOneScroll() */
#define GOS_TOP 	    (1L << 0)
#define GOS_BOT 	    (1L << 1)   /* default if FREEVERT */
#define GOS_LEFT	    (1L << 2)
#define GOS_RIGHT	    (1L << 3)   /* default if FREEHORIZ */

/* dimensions of image data for one-scroll gadgets */
#define GOS_BITWIDTH	16
#define GOS_BITHEIGHT	9
#define GOS_BITDEPTH	1

/* dimensions of Intuition sizing gadget */
#define GIM_SZWIDTH	    16
#define GIM_SZHEIGHT	    9
#define GIM_SZDEPTH	    1
#define GIM_DFLT_TBHEIGHT   10	    /* default Intuition titlebar height */


#ifndef I_AM_GIM_GLOBALS
extern USHORT gimDataOneScrollUp[];
extern USHORT gimDataOneScrollDown[];
extern USHORT gimDataOneScrollLeft[];
extern USHORT gimDataOneScrollRight[];
#endif !I_AM_GIM_GLOBALS


/* flags for gimmeScrollBar(), gimmeFullScrollBar() */
#define GSB_DEFAULT	    (0L)
#define GSB_ONE_SCROLL	    (1L << 0)   /* gimmescrollbar with one-scrolls */
#define GSB_NO_TITLEBAR     (1L << 1)

#endif !GIMMELIB_SCROLLBAR_H
SHAR_EOF
cat << \SHAR_EOF > sound.h
#ifndef GIMMELIB_SOUND_H
#define GIMMELIB_SOUND_H

#ifdef I_AM_SOUND
#define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
				| ((ULONG)(c)<<8) | (ULONG)(d))
#define EVEN(p)         ((p+1) & ~1)

#define ID_FORM 	Mk('F', 'O', 'R', 'M')
#define ID_8SVX 	Mk('8', 'S', 'V', 'X')
#define ID_VHDR 	Mk('V', 'H', 'D', 'R')
#define ID_NAME 	Mk('N', 'A', 'M', 'E')
#define ID_COPY 	Mk('(', 'c', ')', ' ')
#define ID_AUTH 	Mk('A', 'U', 'T', 'H')
#define ID_ANNO 	Mk('A', 'N', 'N', 'O')
#define ID_ATAK 	Mk('A', 'T', 'A', 'K')
#define ID_RLSE 	Mk('R', 'L', 'S', 'E')
#define ID_BODY 	Mk('B', 'O', 'D', 'Y')
#endif I_AM_SOUND


typedef LONG Fixed;	    /* fixed point value 16bits.16bits */

#define Unity 0x10000L	    /* Unity = Fixed 1.0 = maximum volume */

#define sCmpNone	0   /* not compressed */
#define sCmpFibDelta	1   /* Fibonacci delta encoding */

typedef struct _gim_v8h {
    ULONG oneShotHiSamples; /* # samples in the high octave 1-shot part */
    LONG repeatHiSamples;   /* # samples in the high octave repeat part */
    LONG samplesPerHiCycle; /* # samples/cycle in high octave, else 0 */
    UWORD samplesPerSec;    /* data sampling rate */
    UBYTE ctOctave;	    /* # octaves of waveform */
    UBYTE sCompression;     /* data compression technique used */
    Fixed volume;	    /* playback volume from 0 to Unity */
} Voice8Header;

typedef struct {
    UWORD duration;	    /* segment duration in milliseconds, >0 */
    Fixed dest; 	    /* destination volume factor */
} EGPoint;


typedef struct _gim_snd {
    Voice8Header    vh; 	/* info for this sound */
    BYTE	    *body;	/* pointer to body data */
    LONG	    bodylen;	/* actual body length from IFF file */
    void	    *memhead;	/* memory-chain allocated for this sound */
    struct _gim_snd *next;	/* next sound (for future use) */
} SOUND;

#endif !GIMMELIB_SOUND_H
SHAR_EOF
cat << \SHAR_EOF > stdstuff.h
#ifndef GIMMELIB_STDSTUFF_H
#define GIMMELIB_STDSTUFF_H

#ifndef I_AM_STDSTUFF
extern struct IntuitionBase *IntuitionBase;
extern struct GfxBase	    *GfxBase;
extern struct DiskfontBase  *DiskfontBase;
extern struct Device	    *TimerBase;

extern struct MsgPort	    *gimTimerPort;
extern struct timerequest   *gimMasterTR;
extern struct timerequest   *gimSlaveTR;

extern struct MsgPort	    *gimMainPort;
extern SHORT		    gimSubTasks;

extern void		    *gimChainMem;
#endif !I_AM_STDSTUFF


/* handy revision number for gimmeStdStuff() */
#define GSS_REVISION	    33

/* flags for gimmeStdStuff() */
#define GSS_INTUITION	    (1L << 0)       /* IntuitionBase */
#define GSS_GFX 	    (1L << 1)       /* GfxBase */
#define GSS_DISKFONT	    (1L << 2)       /* DiskfontBase */
#define GSS_TIMER	    (1L << 3)       /* timer.device and TimerBase */
#define GSS_SUBTASK	    (1L << 4)       /* gimme.lib subtask mechanism */
#define GSS_MEMCHAIN	    (1L << 15)      /* memory chain */

#define GSS_OPENALL	    (0x000fffffL)   /* open positive things */

/* special bits for gimmeStdStuff() */
#define GSS_DISABLEABORT    (1L << 20)      /* disable ^C */
#define GSS_CLOSEWBENCH     (1L << 21)      /* try to close workbench screen */


/* control flags for getRidOfStdStuff() */
#define GSS_RUTHLESS	    (1L << 25)      /* ignore errors when closing */
#define GSS_ENABLEABORT     (1L << 30)      /* enable ^C */
#define GSS_OPENWBENCH	    (1L << 29)      /* try to open workbench screen */

#define GSS_CLOSEALL	    (GSS_OPENALL)   /* try closing all; stop on error */
#define GSS_KILLALL	    (GSS_CLOSEALL | GSS_RUTHLESS)


#endif !GIMMELIB_STDSTUFF_H

SHAR_EOF
cat << \SHAR_EOF > window.h
#ifndef GIMMELIB_WINDOW_H
#define GIMMELIB_WINDOW_H

#ifdef I_AM_WINDOW
#define GNW_DETAIL_PEN	    -1		/* use default */
#define GNW_BLOCK_PEN	    -1		/* use default */
#define GNW_MIN_WIDTH	    30
#define GNW_MIN_HEIGHT	    20
#endif I_AM_WINDOW


/* these IDCMP flags can be or'd into the window types below */
#define IDCMP_SYS_GADG	(CLOSEWINDOW | NEWSIZE)
#define IDCMP_MOUSE	(MOUSEMOVE)
#define IDCMP_GADGETS	(GADGETUP | GADGETDOWN)

/* mutually exclusive types of window IDCMP */
#define IDCMP_SIMPLE	(IDCMP_SYS_GADG | ACTIVEWINDOW | REFRESHWINDOW)
#define IDCMP_SMART	(IDCMP_SIMPLE)
#define IDCMP_VSMART	((IDCMP_SMART & ~REFRESHWINDOW))
#define IDCMP_MENUWIN	(IDCMP_VSMART | MENUPICK)


/* these flags can be or'd into the window types below */
#define FLAGS_SYS_GADG	(WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING)
#define FLAGS_MOUSE	(REPORTMOUSE)
#define FLAGS_GADGETS	(SIZEBRIGHT | SIZEBBOTTOM)

/* mutually exclusive types of window flags */
#define FLAGS_SIMPLE	(FLAGS_SYS_GADG | SIMPLE_REFRESH | RMBTRAP)
#define FLAGS_SMART	((FLAGS_SIMPLE & ~REFRESHBITS) | SMART_REFRESH)
#define FLAGS_VSMART	(FLAGS_SMART | NOCAREREFRESH)
#define FLAGS_MENUWIN	((FLAGS_VSMART & ~RMBTRAP))


/* defaults use by some gimme Window/Screen routines */
#define IDCMP_DEFAULT	((IDCMP_MENUWIN & ~NEWSIZE) | MENUPICK)
#define FLAGS_DEFAULT	((FLAGS_MENUWIN & ~FLAGS_SYS_GADG) | WINDOWCLOSE \
			    | BACKDROP | BORDERLESS | ACTIVATE)

#endif !GIMMELIB_WINDOW_H
SHAR_EOF
#	End of shell archive
exit 0
-- 
Bob Page, U of Lowell CS Dept.  page@swan.ulowell.edu  ulowell!page
Have five nice days.