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 Development Framework / ODFDev / CyberStarter / Sources / Part.r < prev    next >
Encoding:
Text File  |  1996-09-17  |  7.5 KB  |  287 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.r
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #define SystemSevenOrBetter 1            // we want the extended types
  11. #define    SystemSevenOrLater    1            // Types.r uses this variable
  12.  
  13. #include "Types.r"
  14. #include "SysTypes.r"
  15. #include "CodeFragmentTypes.r"
  16.  
  17. #include "ODTypes.r"
  18. #include "Cyberdog.h"
  19. #include "FWBldDef.h"
  20. #include "Binding.h"
  21.  
  22. //-------------------------------------------------------------------------------------
  23. // cfrg Resource
  24. //-------------------------------------------------------------------------------------
  25.  
  26. resource 'cfrg' (0) {
  27.     {
  28.         //
  29.         // Fully qualified Name (SOMMODULE::SOMCLASS)
  30.         //
  31. #ifdef FW_BUILD_MAC68K
  32.         kMotorola,
  33. #else
  34.         kPowerPC,
  35. #endif
  36.         kFullLib, kNoVersionNum, kNoVersionNum, kDefaultStackSize, kNoAppSubFolder, kIsLib, kOnDiskFlat, kZeroOffset, kWholeFork,
  37.         kEditor,
  38.  
  39.         //
  40.         // Partially qualified Name (SOMCLASS only) 
  41.         // Otherwise identical to above
  42.         //
  43. #ifdef FW_BUILD_MAC68K
  44.         kMotorola,
  45. #else
  46.         kPowerPC,
  47. #endif
  48.         kFullLib, kNoVersionNum, kNoVersionNum, kDefaultStackSize, kNoAppSubFolder, kIsLib, kOnDiskFlat, kZeroOffset, kWholeFork,
  49.         "ODFCyberStarter"
  50.     }
  51. };
  52.  
  53. //-------------------------------------------------------------------------------------
  54. // NMAP Constants
  55. //-------------------------------------------------------------------------------------
  56.  
  57. #define kKindCategoryMapID            128
  58. #define kEditorKindMapID            129
  59. #define kEditorUserStringMapID        130
  60. #define kKindUserStringMapID        131
  61. #define kCategoryUserStringMapID    132
  62. #define kOldMacOSTypeMapID            133
  63. #define kEditorPlatformKinds        134
  64.  
  65. //-------------------------------------------------------------------------------------
  66. // NMAP Resources
  67. // 
  68. // kODEditorKinds            What kinds can this part open? (both OpenDoc and MIME)
  69. // kODKindOldMacOSType        What icon to use for each kind?
  70. // kODEditorPlatformKind    What mac files can be translated to this part?
  71. // kODKind                    Why category does this parts kinds belong to?
  72. // kODEditorUserString        English/etc name for the part.
  73. // kODKindUserString        English/etc name for the kind.
  74. // kODCategoryUserString    English/etc name for the category (if non-standard).
  75. //-------------------------------------------------------------------------------------
  76.  
  77. // These depend on the binding information (Binding.h)
  78. #define kCyberKindID     kODISOPrefix kMimeType
  79. #define kCyberKindID2    kODISOPrefix kMimeType2
  80.  
  81. // A CyberItem (X) which points to some item (Y) will have the
  82. // same data kind as Y, only with "Apple:Cyberdog:Kind:CyberItem:MIME:" in 
  83. // the middle. We never really need to deal with this, except in the 
  84. // kODKindOldMacOSType namp, where we specify which icon to use for the
  85. // CyberItem.
  86. #define kURLKind        kODISOPrefix "Apple:Cyberdog:Kind:CyberItem:MIME:" kMimeType
  87. #define kURLKind2        kODISOPrefix "Apple:Cyberdog:Kind:CyberItem:MIME:" kMimeType2
  88.  
  89. resource kODNameMappings (kKindCategoryMapID) {
  90.     kODKind, {
  91.     //
  92.     // What "categories" does our part data fall into?
  93.     // This information is only used to group editors in Editor Setup and
  94.     // the Document Info window and isn't used during part binding.
  95.     //
  96.         kKind, kODIsAnISOStringList {{
  97.             kCategory
  98.         }}
  99.     }
  100. };
  101.  
  102. resource kODNameMappings (kEditorKindMapID) {
  103.     kODEditorKinds, {
  104.     //
  105.     // ****IMPORTANT*****
  106.     // What kinds of data will be opened by this editor?
  107.     // If you list a data type here then OpenDoc will open your part when
  108.     // it sees that kind of data.
  109.     // You ****MUST**** list your data kinds here to get your part opened by Cyberdog.
  110.     // If OpenDoc has multiple parts for the same kind of data, then it will
  111.     // use Editor Setup to decide which part to use. But if your part is the only one
  112.     // then you don't need to bother with Editor Setup.
  113.     //
  114.         kEditor, kODIsAnISOStringList {{
  115.             kKind,                    // OpenDoc data kind
  116.             kMIMEPrefix kMimeType,    // Cyberdog data kind 
  117.             kMIMEPrefix kMimeType2,    // Cyberdog data kind 
  118.             kCyberPartKind             // this is a hack required by Cyberdog
  119.         }}
  120.     }
  121. };
  122.  
  123. resource kODNameMappings (kEditorUserStringMapID) {
  124.     kODEditorUserString, {
  125.         kEditor, kODIsINTLText {
  126.             smRoman, langEnglish, "ODF CyberStarter R2"
  127.         }
  128.     }
  129. };
  130.  
  131. resource kODNameMappings (kKindUserStringMapID) {
  132.     kODKindUserString, {
  133.         kKind, kODIsINTLText { 
  134.             smRoman, langEnglish, "Text"
  135.         },
  136.         kCyberKindID, kODIsINTLText {
  137.             smRoman, langEnglish, "Text Alias"
  138.         },
  139.         kCyberKindID2, kODIsINTLText {
  140.             smRoman, langEnglish, "Text Alias"
  141.         }
  142.     }
  143. };
  144.  
  145. #if 0
  146.  
  147. resource kODNameMappings (kCategoryUserStringMapID) {
  148.     kODCategoryUserString, {
  149.     //
  150.     // This string is displayed in the Editor Setup control panel. It describes
  151.     // the group that your data kind(s) belong(s) to.
  152.     // For instance: A Postscript kind belongs to the Text, Image, and Program categories.
  153.     // Don't specify a CategoryUserString if you are using a standard OpenDoc category
  154.     // (kODCategory...) (hence the #if 0 around this entry)
  155.     // You should REALLY REALLY try to use a standard one (they are defined in <StdDefs.xh>)
  156.     // If you have a custom category then change the #if 0 to a #if 1 above.
  157.     //
  158.         kCategory, kODIsINTLText {
  159.             smRoman, langEnglish, "New Stuff"
  160.         }
  161.     }
  162. };
  163.  
  164. #endif
  165.  
  166. resource kODNameMappings (kOldMacOSTypeMapID) {
  167.     kODKindOldMacOSType, {
  168.         //
  169.         // Icons
  170.         // These are used only to determine what icon the finder displays for your
  171.         // OpenDoc document and URL file (a.k.a. Cyberdog "CyberItem") in the Notebook.
  172.         // These OSTypes are not related to binding and should be unique!
  173.         //
  174.         kKind,             kODIsMacOSType { kDocumentIcon },
  175.         kURLKind,         kODIsMacOSType { kURLIcon },
  176.         kURLKind2,        kODIsMacOSType { kURLIcon }
  177.     }
  178. };
  179.  
  180. #if 0 // XXX need to handle in Internalize
  181. resource kODNameMappings (kEditorPlatformKinds) {
  182.     kODEditorPlatformKind, {
  183.     //
  184.     // Data Translation
  185.     // If you want your part to get created when standard files or data are dragged
  186.     // into OpenDoc, you need to list them here.
  187.     // For instance, if someone drags text or a text file into a container part,
  188.     // we want CyberStarter (since it displays text) to get created. Therefore
  189.     // we list TEXT here.
  190.     //
  191.         kEditor, kODIsPltfmTypeSpac {{
  192.             kODPlatformFileType, kImportMacOSType, smRoman, langEnglish, "Text File", kCategory,
  193.             kODPlatformDataType, kImportMacOSType, smRoman, langEnglish, "Text Data", kCategory
  194.         }}
  195.     }
  196. };
  197. #endif 
  198.  
  199. //-------------------------------------------------------------------------------------
  200. // Finder Bundle
  201. // I'm putting this here because we can use constants. I know it's a pain. We
  202. // really need a wizard for this kind of thing.
  203. //-------------------------------------------------------------------------------------
  204.  
  205. resource 'BNDL' (128) {
  206.     kPartSignature,
  207.     0, {
  208.         'FREF', { 
  209.             0, 128
  210.         },
  211.         'ICN#', { 
  212.             0, 130
  213.         }
  214.     }
  215. };
  216.  
  217. resource 'BNDL' (129) {
  218.     kODShellSignature, 
  219.     0, {
  220.         'FREF', {
  221.             1, 132,
  222.             2, 133,
  223.         },
  224.         'ICN#', {
  225.             1, 128,
  226.             2, 129,
  227.         }
  228.     }
  229. };
  230.  
  231. // Cyberdog Bundle
  232. // This is used to show icons for the "CyberItem" files (i.e. URLs) on the
  233. // desktop and in the Notebook.
  234.  
  235. resource 'BNDL' (130) {
  236.     kCyberdogCreator, 
  237.     0, {
  238.         'FREF', {
  239.             0, 129
  240.         },
  241.         'ICN#', {
  242.             0, 131
  243.         }
  244.     }
  245. };
  246.  
  247. resource 'FREF' (128) {
  248.     'shlb',
  249.     0,
  250.     ""
  251. };
  252.  
  253. resource 'FREF' (132) {
  254.     kDocumentIcon,
  255.     1,
  256.     ""
  257. };
  258.  
  259. resource 'FREF' (133) {
  260.     kStationeryIcon,
  261.     2,
  262.     ""
  263. };
  264.  
  265. resource 'FREF' (129) {
  266.     kURLIcon,
  267.     0,
  268.     ""
  269. };
  270.  
  271. type kODShellSignature     { pstring; };
  272. type kPartSignature { pstring; };
  273. type kCyberdogCreator { pstring; };
  274.  
  275. resource kODShellSignature (0) {
  276.     ""
  277. };
  278.  
  279. resource kPartSignature (0) {
  280.     ""
  281. };
  282.  
  283. resource kCyberdogCreator (0) {
  284.     ""
  285. };
  286.  
  287.