home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / NavServices1.0b3 / Navigation Services SDK / Examples / SimpleText / SimpleText ƒ / MacIncludes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  5.4 KB  |  196 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MacIncludes.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put the technology version here xxx
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Keith Mortensen
  13.  
  14.         Other Contact:        xxx put alternate contact (owner’s functional manager) here xxx
  15.  
  16.         Technology:            xxx put the technology group name here xxx
  17.  
  18.     Writers:
  19.  
  20.         (KLM)    Keith Mortensen
  21.  
  22.     Change History (most recent first):
  23.  
  24.          <2>      1/5/98    KLM        removed BUILDING_FOR_SYSTEM7, PRAGMA_IMPORT_SUPPORTED, swiped
  25.                                     macros and enums
  26. */
  27.  
  28. /*
  29.     File:        MacIncludes.h
  30.  
  31.     Contains:    This file contains all of the Mac includes that one needs
  32.  
  33.     Version:    SimpleText 1.4 or later
  34.  
  35. ** Copyright 1993-1996 Apple Computer. All rights reserved.
  36. **
  37. **    You may incorporate this sample code into your applications without
  38. **    restriction, though the sample code has been provided "AS IS" and the
  39. **    responsibility for its operation is 100% yours.  However, what you are
  40. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  41. **    after having made changes. If you're going to re-distribute the source,
  42. **    we require that you make it clear in the source that the code was
  43. **    descended from Apple Sample Code, but that you've made changes.
  44.  
  45. */
  46.  
  47.  
  48. #ifndef __MACINCLUDES__
  49. #define __MACINCLUDES__
  50.  
  51. #define SystemSevenOrLater                    1
  52. #define    BUILDING_FOR_SYSTEM7_AND_SYSTEM8    1
  53. #define OLDROUTINENAMES                        1
  54.  
  55. #ifndef FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  56. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES 0
  57. #endif
  58.  
  59. #include <StdArg.h>
  60. #include <Limits.h>
  61. #include <Types.h>
  62. #include <Resources.h>
  63. #include <QuickDraw.h>
  64. #include <Fonts.h>
  65. #include <Events.h>
  66. #include <Windows.h>
  67. #include <Menus.h>
  68. #include <TextEdit.h>
  69. #include <Dialogs.h>
  70. #include <ToolUtils.h>
  71. #include <Memory.h>
  72. #include <SegLoad.h>
  73. #include <Files.h>
  74. #include <OSUtils.h>
  75. #include <Traps.h>    
  76. #include <Script.h>
  77. #include <ColorPicker.h>
  78. #include <FixMath.h>
  79. #include <Packages.h>
  80. #include <Math.h>
  81. #include <Palettes.h>
  82. #include <QDOffscreen.h>
  83. #include <DeskBus.h>
  84. #include <StdLib.h>
  85. #include <StdArg.h>
  86. #include <Strings.h>
  87. #include <StdIO.h>
  88. #include <Sound.h>
  89. #include <Errors.h>
  90. #include <AppleEvents.h>
  91. #include <DiskInit.h>
  92. #include <Retrace.h>
  93. #include <Folders.h>
  94. #include <Lists.h>
  95. #include <CTBUtilities.h>
  96. #include <Gestalt.h>
  97. #include <Finder.h>
  98. #include <Scrap.h>
  99. #include <Devices.h>
  100. #include <Video.h>
  101. #include <Aliases.h>
  102. #include <SoundInput.h>
  103. #include <Movies.h>
  104. #include <Printing.h>
  105. #include <Balloons.h>
  106. #include <MixedMode.h>
  107. #include <Drag.h>
  108. #include <TSMTE.h>
  109. #include <AppleGuide.h>
  110. #include <Speech.h>
  111. #include <Icons.h>
  112. #include <LowMem.h>
  113. #include <GXMath.h>
  114. #include <GXGraphics.h>
  115. #include <GXEnvironment.h>
  116. #include <GXFonts.h>
  117. #include <GXLayout.h>
  118. #include <GXPrinting.h>
  119. #include <GXMessages.h>
  120. #include <CodeFragments.h>
  121. #include <TextUtils.h>
  122.  
  123. // ----- BEGINNING OF SWIPED MACROS -----
  124. // Things that should be in the standard Maxwell versions of headers, but
  125. // are not.  Probably should clean up a bit w.r.t. using window refs and the like
  126.  
  127. #define GetDialogKeyboardFocusItem(dialog) ((*(SInt16 *) (((UInt8 *) dialog) + 164)) < 0 ? -1 : (*(SInt16 *) (((UInt8 *) dialog) + 164)) + 1)
  128.  
  129. // ----- END OF SWIPED MACROS -----
  130.  
  131. #include "AGFile.h"
  132.  
  133. // Balloons.h
  134. #define kDefaultBalloonVariant    2
  135.  
  136. // Fonts.h
  137. #if !GENERATINGPOWERPC
  138.     pascal short GetDefFontSize(void)
  139.     = {0x3EB8,0x0BA8,0x6604,0x3EBC,0x000C};
  140. #endif
  141.  
  142. // GXPrinterDrivers.h
  143. #if GENERATINGPOWERPC
  144.     // in the old library, these are not automagically remapped from the
  145.     // forward messages, so we do so via Macros.  At some point, can remove
  146.     // this once SCM libs catch up.
  147.     #undef Forward_GXPrintingEvent
  148.     #undef Forward_GXCompleteSpoolFile
  149.     #undef Send_GXSpoolResource
  150.     
  151. // Jason Yeo: the follwoing 3 functions used to be extern Psacal OSErr ....
  152.     extern OSErr Forward_GXPrintingEvent(EventRecord *evtRecord, Boolean filterEvent);
  153.     extern OSErr Forward_GXCompleteSpoolFile(gxSpoolFile theSpoolFile);    
  154.     extern OSErr Send_GXSpoolResource(gxSpoolFile theSpoolFile, Handle theResource, ResType theType, long id);    
  155. #endif
  156.  
  157. // For looking at all of our windows, not just the visible ones.
  158. #define    LMGetFirstWindow() (* (WindowRef*) 0x9D6)
  159.  
  160. // No glue for this either, sigh.
  161. #define TESetClickLoop(L,H) ((**(H)).clickLoop = (L))
  162.  
  163. // defines I like to use all of the time
  164. extern void _DataInit();        // part of Runtime library
  165.  
  166. #define TopLeft(aRect)    (* (Point *) &(aRect).top)
  167. #define BotRight(aRect)    (* (Point *) &(aRect).bottom)
  168.  
  169. #define RectWidth(aRect) ((aRect).right - (aRect).left)
  170. #define RectHeight(aRect) ((aRect).bottom - (aRect).top)
  171.  
  172. #define Max(X, Y) ( ((X)>(Y)) ? (X) : (Y) )
  173. #define Min(X, Y) (  ((X)>(Y)) ? (Y) : (X) )
  174.  
  175. #define Pin(VALUE, MIN, MAX) ( ((VALUE) < (MIN)) ? (MIN) : ( ((VALUE) > (MAX)) ? (MAX) : (VALUE) ) )
  176.  
  177. #define nrequire(CONDITION, LABEL) if (true) {if ((CONDITION)) goto LABEL; }
  178. #define require(CONDITION, LABEL) if (true) {if (!(CONDITION)) goto LABEL; }
  179.  
  180. // The Pascal equivalent of strcpy, takes two Pascal string pointers
  181. #define PSTRCPY(P1, P2)    BlockMove(P2, P1, P2[0]+1)
  182.  
  183. // Concatante one character C onto the string S 
  184. #define CHARCAT(S, C)    S[(S[0]+1)] = C; S[0]++;
  185.  
  186. /* The Pascal equivalent of strcat, takes two Pascal string pointers */
  187. #define PSTRCAT(P1, P2)                         \
  188.     BlockMove(&P2[1], &P1[(P1[0]+1)], P2[0]);    \
  189.     P1[0] += P2[0];
  190.  
  191. #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION < 0x300)
  192. #define CheckMenuItem(menu, item, checked) CheckItem(menu, item, checked)
  193. #endif
  194.  
  195. #endif /* __MACINCLUDES__ */
  196.