18 #include <Quickdraw.h>
21 #include <ToolUtils.h>
25 #include <StandardFile.h>
35 if (EventAvail( keyDownMask+autoKeyMask, &ev)) {
36 if ( (ev.modifiers & cmdKey)
37 && ((
char)(ev.message & charCodeMask) ==
'.') ) {
39 (void) GetNextEvent( keyDownMask+autoKeyMask, &ev);
49 return BitTst(kmap, (
sizeof(KeyMap)*8) - 55);
55 return BitTst(kmap, (
sizeof(KeyMap)*8) - 56);
61 return BitTst(kmap, (
sizeof(KeyMap)*8) - 57);
67 return BitTst(kmap, (
sizeof(KeyMap)*8) - 58);
77 return EventAvail( keyDownMask+keyUpMask+autoKeyMask, &ev);
90 static char filename[80] =
"\0";
96 SFGetFile(wher, prompt, nil, nFileTypes, fileTypes, nil, &reply);
99 len = SetVol(nil, reply.vRefNum);
100 len = reply.fName[0];
101 strncpy(filename, (
char *)(&reply.fName[1]), len);
114 #define addarg(sptr) if (strlen(sptr)>0) { \
115 targv = (char **) realloc( targv, (argc+1) * sizeof(char *)); \
116 targv[argc] = (char *) malloc(1+strlen(sptr) * sizeof(char)); \
117 strcpy( targv[argc], sptr); \
120 char *pword, st[
MAXS];
124 targv = (
char **) malloc(1);
125 if (progname==NULL) progname =
"program";
127 fgets( st,
MAXS, cl);
128 if (!feof(cl) && st!=NULL && *st!=0) {
129 pword = strtok( st,
"\ \n");
130 while (pword!=NULL) {
132 pword = strtok( NULL,
"\ \n");
156 #define nocolorID 130
171 InitGraf((Ptr)&qd.thePort);
182 OSys = SysEnvirons( curSysEnvVers,&theWorld);
213 screenRect = qd.screenBits.bounds;
216 offRight = screenRect.right;
217 offBottom = screenRect.bottom;
218 SetRect(&BaseRect, 40, 60, 472, 282);
219 tempRgn = GetGrayRgn();
220 HLock ((Handle) tempRgn);
221 TotalRect = (**tempRgn).rgnBBox;
222 SetRect(&minRect, 80, 80, (**tempRgn).rgnBBox.right - 40,
223 (**tempRgn).rgnBBox.bottom - 40);
224 HUnlock ((Handle) tempRgn);
229 theGDevice = GetMainDevice();
230 HLock ((Handle) theGDevice);
231 mycolors = (**(**theGDevice).gdPMap).pmTable;
232 numcolor = (**(**theGDevice).gdPMap).pixelSize;
233 HUnlock((Handle) theGDevice);
249 myWindow = NewCWindow(nil, &BaseRect,
"",
true, zoomDocProc,
250 (WindowPtr) -1,
true, 150);
251 SetPort((WindowPtr) myWindow);
252 DrawGrowIcon (myWindow);
254 srcPalette = NewPalette (numcolor, mycolors, pmCourteous, 0);
255 SetPalette ((WindowPtr) myWindow, srcPalette,
true);
260 mymenu0 = GetMenu(appleID);
261 AddResMenu(mymenu0,
'DRVR');
262 InsertMenu(mymenu0,0);
263 mymenu1 = newmenu(129,
"File");
264 appendmenu(mymenu1,
"Start;Quit");
265 InsertMenu(mymenu1,0);
266 mymenu2 = newmenu(130,
"Edit");
267 InsertMenu(mymenu2,0);
291 fprintf(stderr,
"\nEnter command line for %s [cmd-Q to quit]\n", argv[0]);
292 fprintf(stderr,
"-> %s ",argv[0]);
296 siow_main(myargc, myargv);
int readCmdOptions(FILE *cl, char *progname, char ***argv)
main(int argc, char *argv[])
Boolean optionKeyIsDown()
int ccommand(char ***argv)
char * StdGetFile(char *prompt, OSType fileTypes[], int nFileTypes)