home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / DocShell / ShellDef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  12.4 KB  |  360 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ShellDef.h
  3.  
  4.     Contains:    All non-local definitions for the "shell," meaning not
  5.     only the DocShell, but also DraftWindow and the launcher.  The impetus
  6.     for combining previously separate files is to avoid resource id conflicts
  7.     within the shell subsystem and between it an the rest of OpenDoc
  8.     
  9.     Merged from: DfWinDef.h, ODXDef.h, and RlShlDef.h
  10.  
  11.     Owned by: Nick Pilch
  12.  
  13.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  14.  
  15.     Change History (most recent first):
  16.  
  17.         <16>     7/30/96    eeh        1372943: kODAlertShellGenericError and
  18.                                     kODAlertShellCorruptDocError
  19.         <15>    17.07.1996    NP        1369268: Change app heap size.
  20.         <14>     6/27/96    TJ        Removed editor type, now using CFMtype for
  21.                                     system headers.
  22.         <13>     6/23/96    NP        10002: Launch time speedups.
  23.         <12>     6/21/96    jpa        T10002: Changed min/default heap size to
  24.                                     210k. 1358818: Added rsrc ID for File menu.
  25.         <11>     6/21/96    eeh        task 10008: add buttons etc. for AppleGuide
  26.         <10>     6/19/96    NP        10002: Launch time speedups.
  27.          <9>     6/18/96    NP        10002: Launch time speedups.
  28.          <8>     6/14/96    NP        10002: Launch time speedups
  29.          <7>    .06.1996    NP        10002: Launch time fixes, system process.
  30.          <6>     5/31/96    jpa        T10012: Added Quit menu cmd for CyberDog
  31.                                     (does not appear in regular docs!)
  32.          <5>    .04.1996    NP        1286751: Present alert when trying to use
  33.                                     Open… when no Finder is running.
  34.          <4>     4/15/96    TJ        Nolonger include ODXDef.h
  35.          <3>     3/29/96    DM        1334273: rsrc const for new alert 493
  36.          <2>    .03.1996    NP        1307182: Removed STR# index constant.
  37.          <4>    10/31/95    TJ        Made the Splash Screen Non-Modal.#1297413
  38.          <3>    10/26/95    TÇ        1296574 GM:Cannot set default memory
  39.                                     partition size.
  40.          <2>    10/24/95    jpa        1293441: Added more SpaceIsLow alerts.
  41.          <1>     9/29/95    eeh        1287262: first checked in
  42.     
  43.     In Progress:
  44.         
  45.         NP: We only have to have unique resource numbers for resources of the
  46.         same kind. Currently, every resource is given a new unique number here.
  47.         We are going to run out of numbers in our range if we don't change the
  48.         scheme.
  49.  
  50.         LDEFs can have the same ID as anything, since having that ID means
  51.         nothing.  (That is, there's no assumption in the code or toolbox like
  52.         the one that DLOG and DITL ids will match.)
  53.         
  54. */
  55.  
  56. #ifndef _SHELLDEF_
  57. #define _SHELLDEF_
  58.  
  59. #ifndef _RSRCBASE_
  60. #include "RsrcBase.h"
  61. #endif
  62.  
  63.  
  64. #define SUPPORT_QUIT    /* Define to add Quit cmd for APPL processes only, *not* documents */
  65.  
  66. #ifdef SUPPORT_QUIT
  67. #define kODCommandQuit    (kODCommandPrint + 1)    /*//jpa $$$$$ Should be in CmdDef.idl*/
  68. /* CyberDog uses the value of this constant so don't mess with it unnecessarily */
  69. #endif
  70.  
  71.  
  72. #define kODShellLDEFRsrcBase    kODShellRsrcBase
  73.  
  74. /*****************************************************************************
  75.     From:        RlShlDef.h
  76.     The constants following are for the DocShell itself
  77. *****************************************************************************/
  78.  
  79. // File menu to use instead of Document menu in 'APPL' process:
  80. #define kODFileMenuID                    (kODShellRsrcBase + 0)
  81.  
  82. // Do you want to save changes before closing? DLOG
  83. #define    kSHLsvChanges                    (kODShellRsrcBase + 0)                
  84.  
  85. // Revert to the last saved version? DLOG
  86. #define    kSHLsvRevert                    (kODShellRsrcBase + 1)                    
  87.  
  88. // Delete this document? DLOG
  89. #define    kSHLDeleteDLOG                    (kODShellRsrcBase + 2)                    
  90.  
  91. // Error Handling ALRT & errs & STR#
  92. #define    kSHLphGenError                    (kODShellRsrcBase + 3)
  93.  
  94. // Low-memory ALRTs:
  95. #define    kSHLphSpaceIsLow                (kODShellRsrcBase + 4)
  96. #define    kSHLphAppSpaceIsLow                (kODShellRsrcBase + 5)
  97. #define    kSHLphSpaceIsLowNoSave            (kODShellRsrcBase + 31)
  98. #define    kSHLphAppSpaceIsLowNoSave        (kODShellRsrcBase + 32)
  99.  
  100. #define    kODErrUserID                    (kODShellRsrcBase + 6)
  101. #define    kODErrSupportID                    (kODShellRsrcBase + 7)
  102.  
  103. #define    kODErrUserIDStrings                (kODShellRsrcBase + 8)
  104. #define    kODErrSupportIDStrings            (kODShellRsrcBase + 9)
  105.  
  106. // Dragged-to-Trash alert [DISABLED]
  107. // #define kSHLDragToTrashAlert            (kODShellRsrcBase + 10)
  108.  
  109. #define kSHLsvChangesCmdKeyStrs            kSHLsvChanges
  110. #define kSHLsvRevertCmdKeyStrs            kSHLsvRevert
  111. #define kSHLDeleteDLOGCmdKeyStrs        kSHLDeleteDLOG
  112.  
  113. // Save A Copy dialog
  114. #define kSHLSaveCopyDlgID                (kODShellRsrcBase + 11)
  115. #define kSHLSaCDocumentIconID               (kODShellRsrcBase + 12)
  116. #define kSHLSaCStationeryIconID           (kODShellRsrcBase + 13)
  117. #define kSHLSaCDocumentRadioBtn           13
  118. #define kSHLSaCStationeryRadioBtn         14
  119. #define kSHLSaCKindPopupItem              15
  120. #define kSHLSaCDocumentIconItem           16
  121. #define kSHLSaCStationeryIconItem         17
  122.  
  123. #define kSHLSaCKindPopupMenu              (kODShellRsrcBase + 14)
  124.  
  125. // Folder Name strings searching
  126. #define kODEditorsFldrStrID                (kODShellRsrcBase + 15)
  127. #define kODOpenDocPartsFolderStrID        (kODShellRsrcBase + 16)
  128. #define kODShellPlugInFolderStrID        (kODShellRsrcBase + 17)
  129. #define kODStationeryFldrStrID            (kODShellRsrcBase + 18)
  130.  
  131. // Shell Strings STR#
  132. #define kSHLStrsID                        (kODShellRsrcBase + 19)
  133. //#define kSHLStrIndAboutOD                1
  134. /* #define kSHLStrIndMClose                    2        */
  135. /* #define kSHLStrIndMCloseDoc                3        */
  136. #define kSHLStrIndMPartInfo                2
  137. #define kSHLStrIndDSaveACopy            3
  138. #define kSHLStrIndDException            4
  139. #define kSHLStrIndDSaveAs                5
  140.  
  141. // Shell default save a copy string
  142. #define kSHLCopyDefaultStrID            (kODShellRsrcBase + 20)                    
  143.  
  144. // Shell opening pre-OD document name string
  145. #define kSHLPreODDocNameStrID            (kODShellRsrcBase + 21)
  146.  
  147. // Shell new filename construction template
  148. #define kSHLNewFilenameTemplateStrID    (kODShellRsrcBase + 22)
  149.  
  150. // Shell menuitem text construction templates
  151. #define kSHLSaveItemTemplateStrID        (kODShellRsrcBase + 23)
  152. #define kSHLCloseItemTemplateStrID        (kODShellRsrcBase + 24)
  153. #define kSHLDeleteItemTemplateStrID        (kODShellRsrcBase + 25)
  154.  
  155. #define kSHLPlugInErrorStrID            (kODShellRsrcBase + 26)
  156.  
  157. // STR#-misc errors
  158. #define kSHLMiscErrorStringsStrID        (kODShellRsrcBase + 48)
  159. #define kSHLCannotRunUnderMacOS8Index    1
  160.  
  161. // Save To Different Volume dialog
  162. #define kSHLSaveDiffVolDialogID            (kODShellRsrcBase + 27)
  163.  
  164. #define    kODXDoubleClickAlert            (kODShellRsrcBase + 44)
  165.  
  166. // Private error codes. Before adding more, check ErrorDef.idl to ensure uniqueness.
  167. #define kODErrAllWritableVolumesAreFull           -29826
  168. #define kODErrVolumesIsFull                       -29825
  169. #define kODErrDirectoryNotHaveWriteAccess          -29824
  170. #define kODErrCannotSaveACopyOntoCurrentDoc     -29823
  171. #define kODErrCannotSaveACopyOntoBusyDoc          -29822
  172. #define kODErrSystemVolumeIsFull                   -29821
  173. #define kODErrCouldNotBindForeignDocument        -29820
  174. #define kODErrCannotFindShellPlugInsFolder        -29819
  175. #define kODErrCannotFindSystemEditorsFolder        -29818
  176. #define kODErrCannotFindOpenDocLibrariesFolder    -29817
  177. #define    kODErrEditorLibraryNotFound                -29816
  178. #define kODErrCannotSaveAsOntoBusyDoc            -29815
  179.  
  180. #define    kSHLAboutBoxDlogID                (kODShellRsrcBase + 28)
  181.  
  182.  
  183. /*****************************************************************************
  184.     From:        ODXDef.h
  185.     The constants following are for the launcher part of the "shell"
  186. *****************************************************************************/
  187.  
  188. // ALRT resource IDs
  189. #define kODXErrAlert             (kODShellRsrcBase + 29)
  190. #define    kODXAnonErrAlert        (kODShellRsrcBase + 30)
  191.  
  192. //  THESE SHOULD GO INTO A STR# RESOURCE!
  193.  
  194. // Prefs file name resource ID
  195. #define kSHLPrefsFileNameResID    (kODShellRsrcBase + 31)
  196. #define kSHLPrefsFolderNameResID (kODShellRsrcBase + 43)
  197. #define kSHLLauncherNameResID (kODShellRsrcBase + 46)
  198. #define kSHLSystemProcessNameResID (kODShellRsrcBase + 47)
  199. #define kSHLOldLauncherNameResID (kODShellRsrcBase + 49)
  200.  
  201.  
  202. #define kPrefFileType        'pref'
  203. // for stationery creation
  204. #define    kDocSeedResType        'seed'
  205. #define    kDocSeedResID        1
  206.  
  207. // Document Stub Data                    Document Stub App
  208. // kDocStubRsrcType kDocStubRsrcID0        kcfrgRsrcType    kcfrgID
  209. // kDocStubRsrcType kDocStubRsrcID1        kMainCFMType    kMainCFMPPCID
  210. // kDocStubRsrcType kDocStubRsrcID2        kscszRsrcType    kscszID
  211. // kDocStubRsrcType kDocStubRsrcID3        kMainCFMType     kMainCFM68KID
  212. // kDocStubRsrcType kDocStubRsrcID4        kMainCFMType     kMainCFM68KID1
  213. // kDocStubRsrcType kDocStubRsrcID5        kCODERsrcType    kCODEID0
  214. // kDocStubRsrcType kDocStubRsrcID6        kCODERsrcType     kCODEID1
  215. // kDocStubRsrcType kDocStubRsrcID7        kCODERsrcType    kCODEID6
  216. // kDocStubRsrcType kDocStubRsrcID8        kCODERsrcType     kCODEID7
  217. // kDocStubRsrcType kDocStubRsrcID9        kMainCFMType     kSOMMemCFM68KID
  218. // kDocStubRsrcType kDocStubRsrcID10    kMainCFMType     kSOMMemCFMPPCID
  219. // kSIZERsrcType     kDocStubSIZEID        kSIZERsrcType    kSIZEID
  220. //
  221.  
  222. // for document stub data (e.g. types & ids of the doc stub app resources when stored
  223. // in OpenDoc™ & OpenDoc Shell)
  224. #define    kSIZERsrcType        'SIZE'
  225. #define kDocStubSIZEID        3
  226.  
  227. // Default SIZE ID for use if there is no prefs file:
  228. #define kDocStubDefaultSIZEID    4
  229.  
  230. #define kDocStubRsrcType    'DSDT'    // for Document Stub DaTa, i.e. how these resources
  231.                                     // are actually stored in OpenDoc™ & OpenDoc Shell
  232.                                     // except for the SIZE resource which we keep as
  233.                                     // a SIZE resource for the convenience of editing it
  234.                                     // in Resedit.
  235.                                     
  236. #define kDocStubRsrcID0        0
  237. #define kDocStubRsrcID1        1
  238. #define kDocStubRsrcID2        2
  239. #define kDocStubRsrcID3        3
  240. #define    kDocStubRsrcID4        4
  241. #define    kDocStubRsrcID5        5
  242. #define    kDocStubRsrcID6        6
  243. #define    kDocStubRsrcID7        7
  244. #define    kDocStubRsrcID8        8
  245. #define    kDocStubRsrcID9        9
  246. //#define    kDocStubRsrcID10    10
  247.  
  248. // for document stub construction
  249. #define    kMainCFMType        'rseg'  // used to be 'DSTB' for Document STuB
  250.                                     // but CFM68K uses 'rseg'.
  251. #define    kMainCFM68KID        0
  252. #define    kMainCFM68KID1        1
  253. #define    kMainCFMPPCID        2
  254. #define kSOMMemCFM68KID        3
  255. #define kSOMMemCFMPPCID        4
  256.  
  257. #define kcfrgRsrcType        'cfrg'
  258. #define kcfrgID                0
  259. #define    kscszRsrcType        'scsz'
  260. #define kscszID                0
  261.  
  262. #define kDocStubStackSize    (64 * 1024)        // 64K stack size
  263.  
  264. // Note: the following two constants are duplicated in InfoDlg.cpp!
  265. // Be sure to keep them in sync.
  266. // 1242449 Should probably create a common ≈def.h constant kDocStubMinHeapSize
  267. // accessible from both subsystems.
  268. #define    kDocStubMinHeapSize    (256 * 1024)    // 256K min app heap
  269. #define    kDocStubDefaultSize    (320 * 1024)    // 320K default app heap [Was 384k in 1.0.4]
  270.  
  271. #define kCODERsrcType        'CODE'
  272. #define kCODEID0            0
  273. #define kCODEID1            1
  274. #define kCODEID6            6
  275. //#define kCODEID7            7
  276.  
  277. #define    kSIZEID                -1
  278.  
  279. // Strings for the Launcher
  280. #define    kODXLibsFldrStrID        (kODShellRsrcBase + 32)
  281. #define kODXLibsFldrStrIndex    1
  282. #define kODXTriedToOpenPrefsStrIndex        2
  283.  
  284. #define kLaunchFailedErrStrings    (kODShellRsrcBase + 33)
  285.  
  286.  
  287. /*****************************************************************************
  288.     From:        DfWinDef.h
  289.     The constants following are for the Draft Window part of the shell
  290. *****************************************************************************/
  291.  
  292. /* DLOG IDs */
  293. #define kDraftsDlgID            (kODShellRsrcBase + 34)
  294. #define kCreateDraftsDlgID        (kODShellRsrcBase + 35)
  295. #define kDeleteDraftsDlogID        (kODShellRsrcBase + 36)
  296.  
  297. /* 'STR ' IDs */
  298. #define kDraftsWnTitleResID        (kODShellRsrcBase + 37)
  299. #define kDraftsWnDateSpaceResID    (kODShellRsrcBase + 38)
  300.  
  301. /* LDEF stuff */
  302. #define kDWNumColumns 4
  303. #define kDraftWinLDEFID            (kODShellLDEFRsrcBase + 0)        
  304. #define kDraftWinLDEFAddrOffset    0x00000008
  305.  
  306. /* fields in Drafts dialog */
  307. #define kDraftsCreateBtn            1
  308. #define kDraftsDoneBtn                2
  309. #define kDraftsDeleteBtn            3
  310. #define kDraftsOpenBtn                4
  311. #define kDraftsCreatorStaticTxt        5
  312. #define kDraftsDraftStaticTxt        6
  313. #define kDraftsCreatedStaticTxt        7
  314. #define kDraftsArrowStaticTxt        8            /* a null string */
  315. #define kDraftsCommentStaticTxt        9
  316. #define kDraftsHeaderRectUserItem    10
  317. #define kDraftsHorizRectUserItem    11
  318. #define kDraftsListUserItem            12
  319. #define kDraftsCreateUserItem        13
  320. #define kDraftsDoneUserItem            14
  321. #define kDraftsAGButtonItem            15
  322.  
  323. #define kDraftsCmdKeyStrs            (kODShellRsrcBase + 39)
  324. #define kDraftsCreateCmdKeyStrs        (kODShellRsrcBase + 40)
  325.  
  326. /* fields in Create Drafts dialog */
  327. #define kCreateDraftsCreateBtn            1
  328. #define kCreateDraftsCancelBtn            2
  329. #define kCreateDraftsDraftStaticTxt        3
  330. #define kCreateDraftsNameStaticTxt        4
  331. #define kCreateDraftsNameEditTxt        5
  332. #define kCreateDraftsCommentsStaticTxt    6
  333. #define kCreateDraftsCommentsEditTxt    7
  334. #define kCreateDraftsDraftEditTxt        8
  335. #define kCreateDraftsAGButtonItem        9
  336.  
  337. /* fields in Delete Drafts dialog */
  338. #define kDeleteDraftsDeleteBtn            1
  339. #define kDeleteDraftsCancelBtn            2
  340. #define kDeleteDraftsStaticTxt            3
  341.  
  342. #define    kDWClosedTriangleResID        (kODShellRsrcBase + 41)
  343. #define    kDWOpenTriangleResID        (kODShellRsrcBase + 42)
  344.  
  345. #define kODAlertShellLowMemoryError (kODShellRsrcBase + 43)
  346. #define kODAlertShellFinderNotRunning (kODShellRsrcBase + 45)
  347. #define kODAlertShellGenericError (kODShellRsrcBase + 46)
  348. #define kODAlertShellCorruptDocError (kODShellRsrcBase + 47)    
  349.  
  350. /*The Splash Screen Dialog ID */
  351. #define kODSplashDlogID                    131
  352.  
  353.  
  354. #define kODSystemProcessSignature 'odbg'
  355. #define kODDisabledProcessSignature 'odno'
  356.  
  357.  
  358. #endif    /* _SHELLDEF_ */
  359.  
  360.