home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / fonts / server / MacFS / MacFontUI.r < prev    next >
Encoding:
Text File  |  1991-07-30  |  9.5 KB  |  379 lines

  1. /***********************************************************************
  2. Copyright 1991 by Apple Computer, Inc, Cupertino, California
  3.             All Rights Reserved
  4.  
  5. Permission to use, copy, modify, and distribute this software
  6. for any purpose and without fee is hereby granted, provided
  7. that the above copyright notice appear in all copies.
  8.  
  9. APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS,
  10. OR IMPLIED, WITH RESPECT TO THIS SOFTWARE, ITS QUALITY,
  11. PERFORMANCE, MERCHANABILITY, OR FITNESS FOR A PARTICULAR
  12. PURPOSE. AS A RESULT, THIS SOFTWARE IS PROVIDED "AS IS,"
  13. AND YOU THE USER ARE ASSUMING THE ENTIRE RISK AS TO ITS
  14. QUALITY AND PERFORMANCE. IN NO EVENT WILL APPLE BE LIABLE 
  15. FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  16. DAMAGES RESULTING FROM ANY DEFECT IN THE SOFTWARE.
  17.  
  18. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE
  19. AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR
  20. IMPLIED.
  21.  
  22. ***********************************************************************/
  23.  
  24. #include "systypes.r"
  25. #include "types.r"
  26.  
  27. #include "MacFontUI.h"
  28.  
  29. #define verUS    0
  30.  
  31. type 'vers' {
  32.         hex byte;                                                /* Major revision in BCD*/
  33.         hex byte;                                                /* Minor vevision in BCD*/
  34.         hex byte    development = 0x20,                            /* Release stage        */
  35.                     alpha = 0x40,
  36.                     beta = 0x60,
  37.                     final = 0x80, /* or */ release = 0x80;
  38.         hex byte;                                                /* Non-final release #    */
  39.         integer        Country;                                    /* Country code            */
  40.         pstring;                                                /* Short version number    */
  41.         pstring;                                                /* Long version number    */
  42. };
  43.  
  44. /* The SIZE resource definition in /mac/lib/rincludes is faulty in A/UX 2.0. */
  45. /* The one given next works. Ignore the warning caused by re-defining SIZE */
  46.  
  47. /*----------------------------SIZE MultiFinder Size Information-----------------------*/
  48. type 'SIZE' {
  49.         boolean                    dontSaveScreen,                    /* for SWITCHER         */
  50.                                 saveScreen;                        /*    compatibility        */
  51.         boolean                 ignoreSuspendResumeEvents,        /* suspend-resume        */
  52.                                 acceptSuspendResumeEvents;
  53.         boolean                    enableOptionSwitch,                /* for SWITCHER         */
  54.                                 disableOptionSwitch;            /*    compatibility        */
  55.         boolean                    cannotBackground,
  56.                                 canBackground;                    /* Can properly use back-
  57.                                                                    ground null events    */
  58.         boolean                    notMultiFinderAware,            /* activate/deactivate    */
  59.                                 multiFinderAware;                /* on resume/suspend    */
  60.         boolean                    backgroundAndForeground,        /* Application does not    */
  61.                                 onlyBackground;                    /* have a user interface*/
  62.         boolean                    dontGetFrontClicks,                /* Get mouse down/up    */
  63.                                 getFrontClicks;                    /* when suspended        */
  64.         boolean                    ignoreChildDiedEvents,            /* Apps use this.        */
  65.                                 acceptChildDiedEvents;            /* Debuggers use this.    */
  66.         boolean                    not32BitCompatible,                /* Works with 24bit addr*/
  67.                                 is32BitCompatible;                /* Works with 24 or 32    */
  68.                                                                 /* bit addresses        */
  69. #undef reserved
  70.         boolean                    reserved;                        /* These seven bits are */        
  71.         boolean                    reserved;                        /* reserved.  Set them    */
  72.         boolean                    reserved;                        /* to "reserved". When    */
  73.         boolean                    reserved;                        /* we decide to define    */
  74.         boolean                    reserved;                        /* a new flag, your        */
  75.         boolean                    reserved;                        /* old resource will     */
  76.         boolean                    reserved;                        /* still compile.        */
  77.         
  78.         /* Memory sizes are in bytes */
  79.         unsigned longint;                                        /* preferred mem size    */
  80.         unsigned longint;                                        /* minimum mem size        */
  81.  
  82.         /* If we ever define one of the seven reserved bits above, the "reserved"
  83.          enumeration wouldn't appear on the newly defined bit.  By defining "reserved"
  84.          below, old resource SIZE declarations will still compile. */
  85. #define    reserved        false
  86. };
  87.  
  88.  
  89.  
  90. resource 'vers' (1) {
  91.     0x00, 0x00, release, 0x00,
  92.     verUS,
  93.     "1.00",
  94.     "1.00, Copyright \251 1991 Apple Computer, Inc."
  95. };
  96.  
  97. /* we use an MBAR resource to conveniently load all the menus */
  98.  
  99. resource 'MBAR' (rMenuBar, preload) {
  100.     { mApple, mFile, mEdit, mFonts };        /* four menus */
  101. };
  102.  
  103.  
  104. resource 'MENU' (mApple, preload) {
  105.     mApple, textMenuProc,
  106.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  107.     enabled, apple,
  108.     {
  109.         "About MacFS\311",
  110.             noicon, nokey, nomark, plain;
  111.         "-",
  112.             noicon, nokey, nomark, plain
  113.     }
  114. };
  115.  
  116. resource 'MENU' (mFile, preload) {
  117.     mFile, textMenuProc,
  118.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  119.     enabled, "File",
  120.     {
  121.         "New",
  122.             noicon, "N", nomark, plain;
  123.         "Open",
  124.             noicon, "O", nomark, plain;
  125.         "-",
  126.             noicon, nokey, nomark, plain;
  127.         "Close",
  128.             noicon, "W", nomark, plain;
  129.         "Save",
  130.             noicon, "S", nomark, plain;
  131.         "Save As\311",
  132.             noicon, nokey, nomark, plain;
  133.         "Revert",
  134.             noicon, nokey, nomark, plain;
  135.         "-",
  136.             noicon, nokey, nomark, plain;
  137.         "Page Setup\311",
  138.             noicon, nokey, nomark, plain;
  139.         "Print\311",
  140.             noicon, nokey, nomark, plain;
  141.         "-",
  142.             noicon, nokey, nomark, plain;
  143.         "Quit",
  144.             noicon, "Q", nomark, plain
  145.     }
  146. };
  147.  
  148. resource 'MENU' (mEdit, preload) {
  149.     mEdit, textMenuProc,
  150.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  151.     enabled, "Edit",
  152.      {
  153.         "Undo",
  154.             noicon, "Z", nomark, plain;
  155.         "-",
  156.             noicon, nokey, nomark, plain;
  157.         "Cut",
  158.             noicon, "X", nomark, plain;
  159.         "Copy",
  160.             noicon, "C", nomark, plain;
  161.         "Paste",
  162.             noicon, "V", nomark, plain;
  163.         "Clear",
  164.             noicon, nokey, nomark, plain
  165.     }
  166. };
  167.  
  168. resource 'MENU' (mFonts, preload) {
  169.     mFonts, textMenuProc,
  170.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  171.     enabled, "Fonts",
  172.     {
  173.     }
  174. };
  175.  
  176.  
  177. /* this ALRT and DITL are used as an About screen */
  178.  
  179. resource 'ALRT' (rAboutAlert, purgeable) {
  180.     {140, 180, 260, 456}, rAboutAlert, {
  181.         OK, visible, silent;
  182.         OK, visible, silent;
  183.         OK, visible, silent;
  184.         OK, visible, silent
  185.     };
  186. };
  187.  
  188. resource 'DITL' (rAboutAlert, purgeable) {
  189.     { /* array DITLarray: 5 elements */
  190.         /* [1] */
  191.         {88, 184, 108, 264},
  192.         Button {
  193.             enabled,
  194.             "OK"
  195.         },
  196.         /* [2] */
  197.         {8, 8, 24, 274},
  198.         StaticText {
  199.             disabled,
  200.             "An X Font Server for A/UX\250"
  201.         },
  202.         /* [3] */
  203.         {32, 8, 48, 237},
  204.         StaticText {
  205.             disabled,
  206.             "Copyright \251 1991 Apple Computer"
  207.         },
  208.         /* [4] */
  209.         {56, 8, 72, 136},
  210.         StaticText {
  211.             disabled,
  212.             "Brought to you by:"
  213.         },
  214.         /* [5] */
  215.         {80, 24, 112, 167},
  216.         StaticText {
  217.             disabled,
  218.             "A/UX Engineering"
  219.         }
  220.     }
  221. };
  222.  
  223.  
  224. /* this ALRT and DITL are used as an error screen */
  225.  
  226. resource 'ALRT' (rUserAlert, purgeable) {
  227.     {140, 200, 250, 440},
  228.     rUserAlert,
  229.     { /* array: 4 elements */
  230.         /* [1] */
  231.         OK, visible, silent,
  232.         /* [2] */
  233.         OK, visible, silent,
  234.         /* [3] */
  235.         OK, visible, silent,
  236.         /* [4] */
  237.         OK, visible, silent
  238.     }
  239. };
  240.  
  241.  
  242. resource 'DITL' (rUserAlert, purgeable) {
  243.     { /* array DITLarray: 3 elements */
  244.         /* [1] */
  245.         {80, 150, 100, 230},
  246.         Button {
  247.             enabled,
  248.             "OK"
  249.         },
  250.         /* [2] */
  251.         {10, 60, 60, 230},
  252.         StaticText {
  253.             disabled,
  254.             "Error. ^0."
  255.         },
  256.         /* [3] */
  257.         {8, 8, 40, 40},
  258.         Icon {
  259.             disabled,
  260.             2
  261.         }
  262.     }
  263. };
  264.  
  265.  
  266. resource 'WIND' (rDocWindow, preload, purgeable) {
  267.     {50, 20, 200, 620},
  268.     zoomDocProc, invisible, noGoAway, 0x0, "MacFS Log"
  269. };
  270.  
  271.  
  272. resource 'CNTL' (rVScroll, preload, purgeable) {
  273.     {-1, 585, 136, 601},
  274.     0, visible, 0, 0, scrollBarProc, 0, ""
  275. };
  276.  
  277.  
  278. resource 'CNTL' (rHScroll, preload, purgeable) {
  279.     {135, -1, 151, 586},
  280.     0, visible, 0, 0, scrollBarProc, 0, ""
  281. };
  282.  
  283. resource 'STR#' (kErrStrings, purgeable) {
  284.     {
  285.     "You must run on 512Ke or later";
  286.     "Application Memory Size is too small";
  287.     "Not enough memory to run MacFS";
  288.     "Not enough memory to do Cut";
  289.     "Cannot do Cut";
  290.     "Cannot do Copy";
  291.     "Cannot exceed 32,000 characters with Paste";
  292.     "Not enough memory to do Paste";
  293.     "Cannot create window";
  294.     "Cannot exceed 32,000 characters";
  295.     "Cannot do Paste";
  296.     "Choose Quit to leave MacFS"
  297.     }
  298. };
  299.  
  300. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  301.  
  302. resource 'SIZE' (-1) {
  303.     dontSaveScreen,
  304.     acceptSuspendResumeEvents,
  305.     enableOptionSwitch,
  306.     canBackground,                /* we can background; we don't currently, but our sleep value */
  307.                                 /* guarantees we don't hog the Mac while we are in the background */
  308.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  309.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  310.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  311.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  312.     is32BitCompatible,            /* this app should not be run in 32-bit address space */
  313.     reserved,
  314.     reserved,
  315.     reserved,
  316.     reserved,
  317.     reserved,
  318.     reserved,
  319.     reserved,
  320.     kPrefSize * 1024,
  321.     kMinSize * 1024    
  322. };
  323.  
  324.  
  325. type 'MOOT' as 'STR ';
  326.  
  327.  
  328. resource 'MOOT' (0) {
  329.     "X Font Server for A/UX\251"
  330. };
  331.  
  332.  
  333. resource 'BNDL' (128) {
  334.     'MOOT',
  335.     0,
  336.     {
  337.         'ICN#',
  338.         {
  339.             0, 128
  340.         },
  341.         'FREF',
  342.         {
  343.             0, 128
  344.         }
  345.     }
  346. };
  347.  
  348.  
  349. resource 'FREF' (128) {
  350.     'APPL',
  351.     0,
  352.     ""
  353. };
  354.  
  355.  
  356. resource 'ICN#' (128) {
  357.     { /* array: 2 elements */
  358.         /* [1] */
  359.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  360.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  361.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  362.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  363.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  364.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  365.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  366.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  367.         /* [2] */
  368.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  369.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  370.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  371.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  372.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  373.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  374.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  375.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  376.     }
  377. };
  378.  
  379.