home *** CD-ROM | disk | FTP | other *** search
-
-
- #define appletinclude /*so other modules can tell if we've been included*/
-
-
- #ifndef __IAC__
-
- #include <iac.h>
-
- #endif
-
-
- #define macintosh
-
- #undef windows
-
-
- #ifdef macintosh
-
- #ifdef MPWC
-
- #include <types.h>
- #include <resources.h>
- #include <dialogs.h>
- #include <menus.h>
- #include <fonts.h>
- #include <events.h>
- #include <controls.h>
- #include <segload.h>
- #include <memory.h>
- #include <toolutils.h>
- #include <packages.h>
- #include <sound.h>
- #include <files.h>
- #include <desk.h>
-
- #endif
-
-
- #define widthsmallicon 16 /*dimensions of a SICN resource*/
- #define heightsmallicon 16
-
- typedef ControlHandle hdlscrollbar;
-
- #define quickdrawglobal(x) qd.x
-
- #define sizegrowicon 15 /*it's square, this is the length of each side*/
-
- #define dragscreenmargin 4 /*for dragging windows, leave this many pixels on all sides*/
-
- #define doctitlebarheight 18 /*number of pixels in the title bar of each standard window*/
-
- #define lenbigstring 255
-
- #define OsType OSType
-
- #define boolean short
-
- #define bigstring Str255
-
- typedef unsigned char *ptrstring, **hdlstring;
-
- #define sysbeep SysBeep(1)
-
- #define stringlength(bs) ((bs)[0])
-
- #define setstringlength(bs,len) (bs[0]=(char)len)
-
- #define setstringwithchar(ch,bs) {bs[0]=1;bs[1]=ch;}
-
- #define setemptystring(bs) (setstringlength(bs,0))
-
- #define isemptystring(bs) (stringlength(bs)==0)
-
- #define isemptyrect(r) EmptyRect (&r)
-
- #include <Printing.h>
-
- #endif
-
-
-
-
-
- #define true 1
- #define false 0
-
- #define infinity 32767
- #define longinfinity (long)0x7FFFFFFF
- #define intinfinity 32767
- #define intminusinfinity -32766
-
- #define emptystring (ptrstring) "\p"
-
- #define chnul ((char) 0)
- #define chbacktab ((char) 0)
- #define chhome ((char) 1)
- #define chenter ((char) 3)
- #define chend ((char) 4)
- #define chhelp ((char) 5)
- #define chbackspace ((char) 8)
- #define chtab ((char) 9)
- #define chlinefeed ((char) 10)
- #define chpageup ((char) 11)
- #define chpagedown ((char) 12)
- #define chreturn ((char) 13)
- #define chescape ((char) 27)
- #define chrightarrow ((char) 29)
- #define chleftarrow ((char) 28)
- #define chuparrow ((char) 30)
- #define chdownarrow ((char) 31)
- #define chsinglequote ((char) 39)
- #define chdoublequote ((char) 34)
- #define chspace ((char) 32)
- #define chdelete ((char) 127)
-
-
- typedef enum tydirection { /*the possible values for a Toolkit direction parameter*/
-
- nodirection = 0,
-
- up = 1,
-
- down = 2,
-
- left = 3,
-
- right = 4,
-
- flatup = 5,
-
- flatdown = 6,
-
- sorted = 8,
-
- pageup = 9,
-
- pagedown = 10,
-
- pageleft = 11,
-
- pageright = 12
- } tydirection;
-
-
- #define ctdirections 12 /*the number of directions, for looping and arrays*/
-
-
- typedef void *ptrvoid;
-
- typedef char *ptrchar;
-
- typedef short *ptrint;
-
- typedef boolean (*callback) ();
-
- typedef unsigned char byte, *ptrbyte;
-
- #define mod %
-
- #define div /
-
- #define abs(x) ((x) < 0? -(x) : (x))
-
- #define odd(x) ((x) % 2)
-
- #define even(x) (!((x) % 2))
-
- #define max(x,y) ((x) > (y)? (x) : (y))
-
- #define min(x,y) ((x) < (y)? (x) : (y))
-
- #define bitboolean(fl) ((fl)?true:false)
-
- #define isnumeric(x) ((x >= '0') && (x <= '9'))
-
- #define longsizeof(x) (long)sizeof(x)
-
-
- extern FontInfo globalfontinfo;
-
-
- typedef struct tykeystrokerecord {
-
- char chkb;
-
- boolean flshiftkey, flcmdkey, floptionkey, flalphalock, flcontrolkey;
-
- short ctmodifiers; /*the number of booleans that are on*/
-
- short keycode; /*see Toolbox Event Manager -- this is the hardware key code*/
-
- boolean flkeypad: 1; /*if true, keystroke comes from numeric keypad*/
-
- boolean flautokey: 1; /*if true, keystroke is an automatic key*/
-
- tydirection keydirection;
- } tykeystrokerecord, *ptrkeystrokerecord, **hdlkeystrokerecord;
-
-
- extern tykeystrokerecord keyboardstatus;
-
-
- typedef struct tymouserecord {
-
- boolean fldoubleclick;
-
- Point localpt;
-
- long mouseuptime;
-
- long mousedowntime;
-
- Point mouseuppoint;
-
- Point mousedownpoint;
-
- boolean fldoubleclickdisabled;
- } tymouserecord;
-
-
- extern tymouserecord mousestatus;
-
-
- typedef struct tyappwindow {
-
- bigstring fname;
-
- short vnum;
-
- short fnum;
-
- short windowvertpixels, windowhorizpixels;
-
- short defaultfont, defaultsize, defaultstyle;
-
- short fontheight;
-
- Handle appdata;
-
- Rect windowrect;
-
- Rect contentrect;
-
- Rect statusrect; /*the rectangle covering the status portion of window*/
-
- WindowPtr macwindow;
-
- hdlscrollbar vertbar, horizbar; /*the window's scrollbars*/
-
- boolean flmadechanges;
-
- boolean flresetscrollbars;
-
- Point scrollorigin;
- } tyappwindow, *ptrappwindow, **hdlappwindow;
-
-
- #define app1class 'app1'
-
-
- typedef boolean (*tyappcallback) (void);
-
- typedef boolean (*tyapphandleptrcallback) (Handle *);
-
- typedef boolean (*tyapphandlecallback) (Handle);
-
- typedef boolean (*tyappbooleancallback) (boolean);
-
- typedef boolean (*tyappshortcallback) (short);
-
- typedef boolean (*tyappsscrollcallback) (tydirection, boolean, short);
-
-
- typedef struct typrintinfo {
-
- Rect paperrect;
-
- short vpagepixels; /*number of pixels on a page, vertically*/
-
- short ctpages; /*the number of pages in the document being printed*/
-
- Handle printhandle; /*a handle to the machine's print record*/
- } typrintinfo;
-
-
- typedef struct tyappletrecord {
-
- hdlappwindow appwindow; /*the frontmost applet window, callbacks work on this*/
-
- Handle appdata; /*a handle allocated by the applet to hold its data*/
-
- long filetype, creator; /*file type and creator for file saving*/
-
- typrintinfo printinfo; /*for coordinating printing between applet and the shell*/
-
- boolean resizeable; /*if true the app's windows can be resized*/
-
- boolean easywindowcreate; /*check it out!*/
-
- boolean statswindow; /*if true, we automatically open stats window for IAC Toolkit*/
-
- boolean horizscroll; /*if true, the applet implements horiz scrolling*/
-
- boolean vertscroll; /*if true, the applet implements vert scrolling*/
-
- boolean notsaveable; /*if true, the applet doesn't implement saving/opening files*/
-
- short statuspixels; /*height of status bar at top of window*/
-
- tyappcallback newrecordcallback; /*allocate and initialize a new data handle*/
-
- tyappcallback disposerecordcallback; /*dealloc a data handle*/
-
- tyappcallback adjustcursorcallback; /*set the mouse cursor according to location*/
-
- tyappbooleancallback activatecallback; /*activate or deactivate the window data*/
-
- tyappcallback updatecallback; /*update the display of the window data*/
-
- tyappcallback windowresizecallback; /*recalc display data, adjust to new window size*/
-
- tyappcallback iacmessagecallback; /*process an IAC message*/
-
- tyapphandleptrcallback packcallback; /*pack memory structure into a disk handle*/
-
- tyapphandlecallback unpackcallback; /*unpack disk handle into memory structure*/
-
- tyapphandleptrcallback gettextcallback; /*return a handle of unformatted ASCII text*/
-
- tyapphandleptrcallback getpictcallback; /*return a Macintosh PicHandle of selected items*/
-
- tyappcallback resetscrollbarscallback; /*set all values for both scrollbars*/
-
- tyappsscrollcallback scrollcallback; /*scroll*/
-
- tyappcallback pagesetupcallback;
-
- tyappcallback openprintcallback;
-
- tyappshortcallback printpagecallback;
-
- tyappcallback closeprintcallback;
-
- tyapphandlecallback puttextcallback;
-
- tyapphandlecallback putpictcallback;
-
- tyappcallback haveselectioncallback;
-
- tyappcallback selectallcallback;
-
- tyappcallback keystrokecallback;
-
- tyappcallback mousecallback;
-
- tyappcallback mouseinstatuscallback;
-
- tyappcallback updatestatuscallback;
- } tyappletrecord, *ptrappletrecord, **hdlappletrecord;
-
-
- extern tyappletrecord app; /*global applet record, short name for easy access*/
-
-
-
-
- boolean apppushwindow (hdlappwindow);
-
- boolean apppopwindow (void);
-
- boolean apppushorigin (void);
-
- boolean apppoporigin (void);
-
- boolean appopenbitmap (Rect, hdlappwindow);
-
- boolean appclosebitmap (hdlappwindow);
-
- boolean pushpen (void);
-
- boolean poppen (void);
-
- boolean pushmacport (GrafPtr);
-
- boolean popmacport (void);
-
- boolean pushclip (Rect);
-
- boolean popclip (void);
-
- boolean pushstyle (short, short, short);
-
- boolean popstyle (void);
-
- boolean equalstrings (bigstring, bigstring);
-
- boolean unicaseequalstrings (bigstring, bigstring);
-
- void copystring (void *, void *);
-
- void centerstring (Rect, bigstring);
-
- boolean pushstring (bigstring, bigstring);
-
- boolean pushspace (bigstring);
-
- void pushlong (long, bigstring);
-
- void pushint (short, bigstring);
-
- void allupper (bigstring);
-
- void alllower (bigstring);
-
- boolean stringlessthan (bigstring, bigstring);
-
- void midstring (bigstring, short, short, bigstring);
-
- boolean pushchar (byte, bigstring);
-
- boolean scanstring (byte, bigstring, short *);
-
- boolean deletestring (bigstring, short, short);
-
- boolean firstword (bigstring, char, bigstring);
-
- boolean lastword (bigstring, char, bigstring);
-
- void ellipsize (Str255, short);
-
- void setfontsizestyle (short, short, short);
-
- boolean newappwindow (bigstring, boolean);
-
- void invalappwindow (hdlappwindow, boolean);
-
- void updateappwindow (hdlappwindow);
-
- boolean findbywindowtitle (bigstring, hdlappwindow *);
-
- boolean findnthwindow (short, hdlappwindow *);
-
- short countwindows (void);
-
- boolean findbyfile (bigstring, short, hdlappwindow *);
-
- boolean newclearhandle (long, Handle *);
-
- boolean newfilledhandle (ptrvoid, long, Handle *);
-
- boolean newheapstring (bigstring, hdlstring *);
-
- void copyheapstring (hdlstring, bigstring);
-
- boolean enlargehandle (Handle, long, ptrchar);
-
- void lockhandle (Handle);
-
- void unlockhandle (Handle);
-
- void disposehandle (Handle);
-
- void moveleft (void *, void *, long);
-
- boolean newtexthandle (bigstring, Handle *);
-
- boolean pushtexthandle (bigstring, Handle);
-
- void texthandletostring (Handle, bigstring);
-
- void arrowcursor (void);
-
- void initbeachball (void);
-
- void rollbeachball (void);
-
- boolean settargetglobals (void);
-
- boolean copyhandle (Handle, Handle *);
-
- void clearbytes (void *, long);
-
- boolean equalrects (Rect, Rect);
-
- void zerorect (Rect *);
-
- void scrollrect (Rect, short, short);
-
- void centerrect (Rect *, Rect);
-
- short getfontheight (void);
-
- void timestamp (long *);
-
- void enablescrollbar (hdlscrollbar);
-
- void disablescrollbar (hdlscrollbar);
-
- void getscrollbarinfo (hdlscrollbar, short *, short *, short *);
-
- void setscrollbarinfo (hdlscrollbar, short, short, short);
-
- extern boolean optionkeydown (void);
-
- extern boolean cmdkeydown (void);
-
- extern boolean shiftkeydown (void);
-
- boolean alertdialog (bigstring);
-
- boolean msgdialog (bigstring);
-
- boolean askdialog (bigstring, bigstring);
-
- boolean oserror (OSErr);
-
- boolean filedelete (bigstring, short);
-
- void fileclose (short);
-
- boolean fileseteof (short, long);
-
- boolean fileopenorcreate (bigstring, short, OSType, OSType, short *);
-
- boolean filenew (bigstring, short, OSType, OSType, short *);
-
- boolean fileopen (bigstring, short, short *);
-
- boolean filetruncate (short);
-
- boolean filewrite (short, long, void *);
-
- boolean fileread (short, long, void *);
-
- boolean filewritehandle (short, Handle);
-
- boolean filereadhandle (short, long, Handle *);
-
- boolean filegetchar (short, byte *);
-
- boolean filefrompath (bigstring, bigstring);
-
- boolean folderfrompath (bigstring, bigstring);
-
- boolean pathtofileinfo (bigstring, bigstring, short *);
-
- boolean directorytopath (long, short, bigstring);
-
- boolean fileinfotopath (bigstring, short, bigstring);
-
- boolean getstringlist (short, short, bigstring);
-
- boolean plotsmallicon (hdlappwindow, Rect, short, short, boolean);
-
- boolean mousetrack (Rect, void (*) (boolean));
-
- boolean FrontierDoScript (bigstring, bigstring);
-
- void initmacintosh (void);
-
- void appletinitmanagers (void);
-
- void runapplet (void);
-
-
-