home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1990-03-06 | 8.0 KB | 401 lines | [ TEXT/MPS ]
/*======================================================================== === unixDA.r === === Greg Anderson === 29 Kerr Hall === Social Sciences Computing === University of California at Santa Cruz === Santa Cruz CA 95062 === === (408) 476-9338 === sirkm@ssyx === === unixDA is a desk accessory that interfaces to Unix services === offered with Steven Grimm's client/server software. === === unixDA requires MacTCP to run. It was written with MPW and === is based on the example "memory" desk accessory provided with === that package. === ========================================================================*/ #include "Types.r" /* To get system types */ #include "SysTypes.r" #include "MPWTypes.r" /* To get 'DRVW' type */ #include "unixDA.h" type 'DRVR' as 'DRVW'; /* Map 'DRVW' => 'DRVR' */ /* * This will produce a DRVR resource from the special DRVW type. * * Note that the ID 12 is irrelevant, since the Font/DA Mover * will renumber it to something else when installing it anyway. * * The leading NUL in the resource name is required to * conform to the desk accessory naming convention. * * The resource is declared purgeable. If the code were to * do funky things like SetTrapAddress calls (requiring the code to * be around at all times), we would have to set it nonpurgeable. */ #define DriverID 12 resource 'DRVR' (DriverID, "\0x00"DA_name, purgeable) { /* * DRVR flags */ dontNeedLock, /* OK to float around, not saving ProcPtrs */ needTime, /* Yes, give us periodic Control calls */ dontNeedGoodbye, /* No special requirements */ noStatusEnable, ctlEnable, /* Desk accessories only do Control calls */ noWriteEnable, noReadEnable, 6, /* drvrDelay - Wake up every 6 jiffies */ updateMask | /* drvrEMask */ activMask | mDownMask | keyDownMask | autoKeyMask, 0, /* drvrMenu - This DA has no menu */ DA_name, /* drvrName - This isn't used by the DA */ /* * This directive inserts the contents of the DRVW resource * produced by linking DRVRRuntime.o with our DA code */ $$resource("unixDA.DRVW", 'DRVW', 0) }; resource 'vers' (1) { 1,1, 0x80,0,0, version, "Client " version " by Greg Anderson\nIn the Public Domain--not for resale" }; resource 'vers' (2) { 1,1, 0x80,0,0, version, "⌐ 1990 UC Regents" }; resource 'STR '(0xC000 | (DriverID << 5), "Default host") { "ssyx.ucsc.edu" }; resource 'STR#'(0xC000 | (DriverID << 5)+1, "Known hosts") { { "ssyx.ucsc.edu=128.114.133.1\n"; "ucschu.ucsc.edu=128.114.180.1\n"; "" } }; /* "ucscb.ucsc.edu,b=128.114.129.6\n"; "ucscc.ucsc.edu=128.114.129.1\n"; "ucsce.ucsc.edu=128.114.129.3\n"; "ucsco.ucsc.edu=128.114.129.14\n"; */ resource 'STR#' (0xC000 | (DriverID << 5), "Client's string constants") { { "ucsco.ucsc.edu"; "[ Abort ]"; "[ Reconnect ]"; "Not enough memory to do Cut"; "Cannot do Cut"; "Cannot do Copy"; "Cannot exceed 32,000 characters with Paste"; "Not enough memory to do Paste"; "Cannot create window"; "Cannot exceed 32,000 characters"; "Cannot do Paste"; "Waiting to open"; ""; ".IPP"; "LIST\r\r\r"; "Error: Out of memory"; "MacTCP driver could not be opened"; "Could not create a stream"; "Error while releasing stream"; "Could not open a connection"; "Error while sending"; "Error while recieving"; /* * TCP errors */ ""; "TCPClose command was already issued"; "The TCP stream already has an open connection"; "No connection on this TCP stream"; "TCP stream is not open"; "Attempted to open stream twice"; "Connection came halfway up and then failed"; "Timeout"; "This socket is in use"; "The destination is dead"; "Unknown error"; "Connection Terminating"; "Looking up Internet Address..."; "No services on "; "Reading service list..."; "Host Name:"; "mark"; /* * Connection state messages */ "Connection Closed"; "Listening"; "SYN recived"; "SYN sent"; "Connection Established"; "FIN Wait 1 (close issued)"; "FIN Wait 2 (close completed)"; "Waiting to close"; "Connection Closing..."; "Last ACK"; "Connection going down..."; "Couldn't get inet address"; "Timed out looking up address"; "Domain Name resolver failed"; "Couldn't open MacTCP resource"; "NameToAddr worked"; "56?" }; }; /* documentProc, */ resource 'WIND' (0xC000 | (DriverID << 5), "unixDA's Window") { {64, 4, 314, 504}, zoomDocProc, invisible, goAway, 0x0, DA_name }; /* Vertical scroll bar */ resource 'CNTL' (0xC000 | (DriverID << 5), preload) { {-1, 485, 236, 501}, 0, visible, 0, 0, scrollBarProc, 0, "" }; /* Horizontal scroll bar */ resource 'CNTL' (0xC000 | (DriverID << 5) + 1, preload) { {235, -1, 251, 486}, 0, visible, 0, 0, scrollBarProc, 0, "" }; /* this ALRT and DITL are used as an error screen */ resource 'ALRT' (0xC000 | (DriverID << 5), purgeable) { {40, 20, 150, 260}, 0xC000 | (DriverID << 5)+1, { /* array: 4 elements */ /* [1] */ OK, visible, silent, /* [2] */ OK, visible, silent, /* [3] */ OK, visible, silent, /* [4] */ OK, visible, silent } }; resource 'DITL' (0xC000 | (DriverID << 5)+1, purgeable) { { /* array DITLarray: 3 elements */ /* [1] */ {80, 150, 100, 230}, Button { enabled, "OK" }, /* [2] */ {10, 60, 60, 230}, StaticText { disabled, "^0. ^1" }, /* [3] */ {8, 8, 40, 40}, Icon { disabled, 2 } } }; /* Main dialog box for selecting services */ resource 'DLOG' (0xC000 | (DriverID << 5)) { {33, 44, 327, 440}, dBoxProc, invisible, goAway, 0x0, 0xC000 | (DriverID << 5), DA_name }; resource 'DITL' (0xC000 | (DriverID << 5)) { { /* array DITLarray: 12 elements */ /* [1] */ {268, 254, 288, 326}, Button { enabled, "Okay" }, /* [2] */ {268, 55, 288, 127}, Button { enabled, "Cancel" }, /* [3] */ {238, 16, 254, 384}, EditText { enabled, "" }, /* [4] */ {216, 16, 232, 384}, StaticText { enabled, "Parameters:" }, /* [5] */ {268, 182, 288, 198}, Button { enabled, "?" }, /* [6] */ {120, 208, 136, 336}, StaticText { enabled, "Internet Address:" }, /* [7] */ {80, 208, 96, 376}, EditText { enabled, "ssyx.ucsc.edu" }, /* [8] */ {140, 208, 156, 376}, StaticText { enabled, "" }, /* [9] */ {48, 16, 210, 184}, UserItem { enabled }, /* [10] */ {6, 40, 40, 368}, StaticText { enabled, " Macintosh Client to Unix Server " version "\n Greg Anderson (c) 1990 UC Regents" }, /* [11] */ {176, 208, 208, 384}, StaticText { enabled, "" }, /* [12] */ {56, 205, 72, 313}, UserItem { enabled } } }; /* HELP dialog box */ resource 'DLOG' (0xC000 | (DriverID << 5) + 2) { {33, 44, 327, 440}, dBoxProc, invisible, goAway, 0x0, 0xC000 | (DriverID << 5)+2, DA_name " Help" }; resource 'DITL' (0xC000 | (DriverID << 5) + 2) { { /* array DITLarray: 9 elements */ /* [1] */ {268, 154, 288, 230}, Button { enabled, "Okay" }, /* [2] */ {208, 40, 264, 72}, StaticText { enabled, "-.\n-A\n-R" }, /* [3] */ {208, 80, 264, 360}, StaticText { enabled, "Abort. The current session will be closed.\nSelect all.\nReturn to the service selection dialog." }, /* [4] */ {184, 8, 200, 392}, StaticText { enabled, "Command key shortcuts available in the Client window:" }, /* [5] */ {144, 128, 176, 392}, StaticText { enabled, "Click on this icon to pull down a list of recently used hosts." }, /* [6] */ {8, 8, 88, 392}, StaticText { enabled, "The Macintosh Client Desk Accessory provides access to programs residing on a Unix host that is running Steven Grimm's superserver. Source code for this server and the Unix-side clients is available via anonymous ftp from ssyx.ucsc.edu." }, /* [7] */ {88, 8, 120, 392}, StaticText { enabled, "This Desk Accessory was developed by Greg Anderson at Social Sciences Computing at UC Santa Cruz." }, /* [8] */ {120, 8, 136, 392}, StaticText { enabled, "It is in the public domain." }, /* [9] */ {144, 8, 160, 116}, UserItem { enabled } } };