home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / fonts / server / MacFS / MacFontUI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-29  |  6.4 KB  |  164 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. #define kPrefSize                512
  25. #define kMinSize                384
  26.     
  27. /* The following constants are used to identify menus and their items. The menu IDs
  28.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  29. #define    mApple                    128        /* Apple menu */
  30. #define    iAbout                    1
  31.  
  32. #define    mFile                    129        /* File menu */
  33. #define    iNew                    1
  34. #define    iClose                    4
  35. #define    iQuit                    12
  36.  
  37. #define    mEdit                    130        /* Edit menu */
  38. #define    iUndo                    1
  39. #define    iCut                    3
  40. #define    iCopy                    4
  41. #define    iPaste                    5
  42. #define    iClear                    6
  43.  
  44. #define mFonts                  131     /* Fonts menu */
  45.  
  46. /*    1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
  47.  
  48. #define kDITop                    0x0050
  49. #define kDILeft                    0x0070
  50.  
  51. /* 1.01 - changed constants to begin with 'k' for consistency, except for resource IDs */
  52. /*    kTextMargin is the number of pixels we leave blank at the edge of the window. */
  53. #define kTextMargin                2
  54.  
  55. /* kMaxOpenDocuments is used to determine whether a new document can be opened
  56.    or created. We keep track of the number of open documents, and disable the
  57.    menu items that create a new document when the maximum is reached. If the
  58.    number of documents falls below the maximum, the items are enabled again. */
  59. #define    kMaxOpenDocuments        1
  60.     
  61. /*    kMaxDocWidth is an arbitrary number used to specify the width of the TERec's
  62.     destination rectangle so that word wrap and horizontal scrolling can be
  63.     demonstrated. */
  64. #define    kMaxDocWidth            576
  65.     
  66. /* kMinDocDim is used to limit the minimum dimension of a window when GrowWindow
  67.     is called. */
  68. #define    kMinDocDim                64
  69.  
  70. /*    kControlInvisible is used to 'turn off' controls (i.e., cause the control not
  71.     to be redrawn as a result of some Control Manager call such as SetCtlValue)
  72.     by being put into the contrlVis field of the record. kControlVisible is used
  73.     the same way to 'turn on' the control. */
  74. #define kControlInvisible        0
  75. #define kControlVisible            0xFF
  76.  
  77. /*    kScrollbarAdjust and kScrollbarWidth are used in calculating
  78.     values for control positioning and sizing. */
  79. #define kScrollbarWidth            16
  80. #define kScrollbarAdjust        (kScrollbarWidth - 1)
  81.  
  82. /*    kScrollTweek compensates for off-by-one requirements of the scrollbars
  83.  to have borders coincide with the growbox. */
  84. #define kScrollTweek            2
  85.     
  86. /*    kCrChar is used to match with a carriage return when calculating the
  87.     number of lines in the TextEdit record. kDelChar is used to check for
  88.     delete in keyDowns. */
  89. #define kCrChar                    13
  90. #define kDelChar                8
  91.     
  92. /*    kButtonScroll is how many pixels to scroll horizontally when the button part
  93.     of the horizontal scrollbar is pressed. */
  94. #define kButtonScroll            4
  95.     
  96. /*    kMaxTELength is an arbitrary number used to limit the length of text in the TERec
  97.     so that various errors won't occur from too many characters in the text. */
  98. #define    kMaxTELength            32000
  99.  
  100. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  101.    SysEnvRec we understand. */
  102. #define    kSysEnvironsVersion        1
  103.  
  104. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  105.    by MultiFinder. Once we determine that an event is an OSEvent, we look at the
  106.    high byte of the message sent to determine which kind it is. To differentiate
  107.    suspend and resume events we check the resumeMask bit. */
  108. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  109. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  110. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  111. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  112. #define    kNoEvents                0        /* no events mask */
  113.  
  114. /* 1.01 - kMinHeap - This is the minimum result from the following
  115.      equation:
  116.             
  117.             ORD(GetApplLimit) - ORD(ApplicZone)
  118.             
  119.      for the application to run. It will insure that enough memory will
  120.      be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  121.      application, and still give the application some 'breathing room'.
  122.      To derive this number, we ran under a MultiFinder partition that was
  123.      our requested minimum size, as given in the 'SIZE' resource. */
  124.      
  125. #define    kMinHeap                 (200 * 1024)
  126.     
  127. /* 1.01 - kMinSpace - This is the minimum result from PurgeSpace, when called
  128.      at initialization time, for the application to run. This number acts
  129.      as a double-check to insure that there really is enough memory for the
  130.      application to run, including what has been taken up already by
  131.      pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  132.      
  133. #define    kMinSpace                (20 * 1024)
  134.  
  135. /*    kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  136. #define kExtremeNeg                -32768
  137. #define kExtremePos                (32767 - 1)    /* required to address an old region bug */
  138.     
  139. /* kTESlop provides some extra security when pre-flighting edit commands. */
  140. #define    kTESlop                    1024
  141.  
  142. /* The following are indicies into STR# resources. */
  143. #define    eWrongMachine            1
  144. #define    eSmallSize                2
  145. #define    eNoMemory                3
  146. #define    eNoSpaceCut                4
  147. #define    eNoCut                    5
  148. #define    eNoCopy                    6
  149. #define    eExceedPaste            7
  150. #define    eNoSpacePaste            8
  151. #define    eNoWindow                9
  152. #define    eExceedChar                10
  153. #define    eNoPaste                11
  154. /* Generic Server FatalError */
  155. #define eFatalError                12
  156.  
  157. #define    rMenuBar    128                /* application's menu bar */
  158. #define    rAboutAlert    128                /* about alert */
  159. #define    rUserAlert    129                /* user error alert */
  160. #define    rDocWindow    128                /* application's window */
  161. #define    rVScroll    128                /* vertical scrollbar control */
  162. #define    rHScroll    129                /* horizontal scrollbar control */
  163. #define    kErrStrings    128                /* error string list */
  164.