home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / CFMExamples / ModApp / ModApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-03  |  2.4 KB  |  126 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ModApp.h
  3.  
  4.     Contains:    General application constants
  5.  
  6.     Written by:    Richard Clark
  7.  
  8.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.                  8/15/94    BLS        added CodeType field to window to
  13.                                      determine when to use mixed mode.
  14.                   7/2/93    RC        d1 release
  15.  
  16.     To Do:
  17. */
  18.  
  19.  
  20. #ifndef __MODAPP__
  21. #define __MODAPP__
  22.  
  23. #ifndef __WINDOWS__
  24.     #include <Windows.h>
  25. #endif
  26.  
  27. #ifndef __FILES__
  28.     #include <Files.h>
  29. #endif
  30.  
  31. #ifndef __CODEFRAGMENTS__
  32.     #include "CodeFragments.h"
  33. #endif
  34.  
  35. #ifndef __TOOLAPI__
  36.     #include "ToolAPI.h"
  37. #endif
  38.  
  39. enum     {
  40.             // File types & creators
  41.             kCreatorCode = 'moda',
  42.             kToolType = 'modt'
  43.         };
  44.  
  45.  
  46. enum    {
  47.             // Internal error codes
  48.             kGenericError = 0,
  49.             kNeedSystem7 = 1,
  50.             kCFMNotPresent,
  51.             kMixedModeNotPresent,
  52.             kCodeNotFound
  53.         };
  54.  
  55. enum    {
  56.             // Menu ID numbers
  57.             kAppleMenu = 1001,
  58.             kFileMenu,
  59.             kEditMenu,
  60.             kModulesMenu,
  61.             kDebugMenu
  62.         };
  63.  
  64. enum    {
  65.             // Apple menu commands
  66.             cAbout = 1
  67.         };
  68.  
  69. enum    {
  70.             // File menu commands
  71.             cNew = 1,
  72.             cClose,
  73.             /* --- */
  74.             cQuit = 4
  75.         };
  76.  
  77. #define    kDisplayWindow    1001
  78. #define    kAboutDialog    1001
  79. #define    kErrorDialog    1002
  80. #define rToolMenuStrings 1001
  81. #define rErrorStrings    1002
  82.  
  83. typedef    Byte    int8;    
  84. typedef    short    int16;
  85. typedef long    int32;
  86.  
  87.  
  88. #ifdef powerc
  89.     #pragma options align=mac68k
  90. #endif
  91. struct DrawingWindow {
  92.     WindowRecord        theWindow;
  93.     Handle                currMenuBar;        // Which menubar goes with this window?
  94.     CFragConnectionID    connectionID;
  95.     Handle                toolResource;
  96.     short                toolLocation;
  97.     short                toolCodeType;       // instruction set and runtime arch.
  98.     FSSpec                toolSpec;
  99.     ToolInfoBlock        toolRoutines;
  100.     long                toolRefCon;            // Tool-specific storage
  101. };
  102. #ifdef powerc
  103.     #pragma options align=reset
  104. #endif
  105.  
  106. typedef struct DrawingWindow DrawingWindow, *DrawingWindowPeek;
  107.  
  108. /* Global Variable Definitions */
  109.  
  110. #ifdef __Main__
  111.     #define    global
  112. #else
  113.     #define    global    extern
  114. #endif
  115.  
  116. global    Boolean        gDone;                  /* quit program flag    */
  117. global    int16        gMenuState;                /* In what state did we last leave our menu bar? */
  118. global    WindowPtr    gCurrentWindow;            /* Which window are we redrawing? */
  119. global    Handle        gCommonMenuBar;            /* The menubar for the app itself, with no tool menus */
  120. global    Boolean        gHasMixedMode;            /* Do we have Mixed Mode? */
  121. global    Boolean        gHasCFM;                /* Do we have the Code Fragment Manager? */
  122.  
  123. #define        isUserWindow(wp)    (wp && (((WindowPeek)wp)->windowKind == userKind))
  124.  
  125. #endif // __MODAPP__
  126.