home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / PR1toPR2.tops < prev    next >
Text File  |  1996-01-22  |  9KB  |  181 lines

  1.  
  2. /***** Conversions for API changes that occurred between PR1 and PR2 *****/
  3.  
  4. /* This script is only interesting to clients that have converted code under PR1 and are moving to PR2.
  5.  
  6.   If you are converting an app from 3.X to 4.0 using PR2, you do NOT need to use this script.  The standard conversion process embodied in the other scripts have produce code conformant to these changes.
  7.  */
  8.  
  9.  
  10. replace "NSCompositeDataOver" with "NSCompositeDestinationOver"
  11. replace "NSCompositeDataIn" with "NSCompositeDestinationIn"
  12. replace "NSCompositeDataOut" with "NSCompositeDestinationOut"
  13. replace "NSCompositeDataAtop" with "NSCompositeDestinationAtop"
  14.  
  15. replace "NSColorListChangedNotification" with "NSColorListDidChangeNotification"
  16. replace "NSColorPanelColorChangedNotification" with "NSColorPanelColorDidChangeNotification"
  17. replace "NSImageRepRegistryChangedNotification" with "NSImageRepRegistryDidChangeNotification"
  18. replace "NSViewFocusChangedNotification" with "NSViewFocusDidChangeNotification"
  19. replace "NSViewFrameChangedNotification" with "NSViewFrameDidChangeNotification"
  20. replace "NSViewBoundsChangedNotification" with "NSViewBoundsDidChangeNotification"
  21.  
  22. replace "NSDragOperation" with "unsigned int"
  23.  
  24. replace "[<obj> setType:<aButtonTypeConstant>]" with "[<obj> setButtonType:<aButtonTypeConstant>]"
  25.     where "<aButtonTypeConstant>" isOneOf {
  26.         "NSMomentaryPushButton",
  27.     "NSPushOnPushOffButton",
  28.     "NSToggleButton",
  29.     "NSSwitchButton",
  30.     "NSRadioButton",
  31.     "NSMomentaryChangeButton",
  32.     "NSOnOffButton"
  33.     }
  34.  
  35. replace "NSMenuCell" with "NSMenuItem"
  36.  
  37.  
  38. replacemethod "text" with "string"
  39. replacemethod "setText:" with "setString:"
  40. replacemethod "setText:<1>range:<2>" with "replaceCharactersInRange:<2>withString:<1>"
  41. replacemethod "replaceRange:withRTF:" with "replaceCharactersInRange:withRTF:"
  42. replacemethod "replaceRange:withRTFD:" with "replaceCharactersInRange:withRTFD:"
  43. replacemethod "setColor:ofRange:" with "setTextColor:range:"
  44. replacemethod "setFont:ofRange:" with "setFont:range:"
  45. replacemethod "substringFromRange:" with "substringWithRange:"
  46.  
  47. replacemethod "fixAttributesAfterEditingRange:" with "fixAttributesInRange:"
  48. replacemethod "fixAttachmentAfterEditingRange:" with "fixAttachmentAttributeInRange:"
  49. replacemethod "fixFontAttributeAfterEditingRange:" with "fixFontAttributeInRange:"
  50. replacemethod "fixParagraphStyleAfterEditingRange:" with "fixParagraphStyleAttributeInRange:"
  51.  
  52.  
  53. replace "NSRunLocalizedAlertPanel(<table>, <title>, <msg>, <defaultButton>, <alternateButton>, <otherButton>, <b args>)" with "NSRunAlertPanel(<title>, <msg>, <defaultButton>, <alternateButton>, <otherButton>, <b args>)"
  54.     warning "GeneralAPIConversion: NSRunLocalizedAlertPanel is obsolete, and has been converted to NSRunAlertPanel.  You may need to localize the arguments using the StringTable <table>."
  55.  
  56.  
  57. replacemethod "drawTitle:<title> inRect:<rect> ofColumn:<col>" with "drawTitleOfColumn:<col> inRect:<rect>"
  58.     within ("<implementation>") {
  59.     replace "<title_param>" with same
  60.         error "BrowserConversion:  title is no longer passed in.  You must figure out the title from the column index."
  61.     }
  62.  
  63.  
  64. replacemethod "minColumnWidth" with same {
  65.     replace "<rettype>" with "(float)"
  66. }
  67.  
  68. replacemethod "setMinColumnWidth:<nowfloat>" with same {
  69.     replace "<nowfloat_type>" with "(float)"
  70. }
  71.  
  72. replacemethod "browser:selectCell:inColumn:" with "browser:selectCellWithString:inColumn:"
  73.  
  74. replacemethod "control:validateObject:" with "control:isValidObject:"
  75.  
  76. replacemethod "registerServiceProvider:<1>withName:<2>" with "setServicesProvider:<1>"
  77.  
  78. replace "[<app> unregisterServiceProviderNamed:<1>]" with "[<app> setServicesProvider:nil]"
  79.  
  80. replace "NSHelpPanel" with same
  81.     error "PR1toPR2:  NSHelpPanel is obsolete.  Use NSHelpManager."
  82.  
  83. replace "NSNumberFormatter" with same
  84.     error "PR1toPR2: NSNumberFormatter is not included in PR2.  A completely new number formatter will be available in the final release."
  85.  
  86.  
  87. /* conversion script for PR1 to PR2 Foundation changes */
  88.  
  89. /* Deleted API */
  90. replace "NSAccount" with "NSAccount"
  91.     error "PR1toPR2Conversion: NSAccount has been removed; use NSPathUtilities.h functions"
  92. replace "NSUserAccount" with "NSUserAccount"
  93.     error "PR1toPR2Conversion: NSUserAccount has been removed"
  94. replace "NSGroupAccount" with "NSGroupAccount"
  95.     error "PR1toPR2Conversion: NSGroupAccount has been removed"
  96. replace "NSAllocationEvents" with "NSAllocationEvents"
  97.     error "PR1toPR2Conversion: NSAllocationEvents has been removed"
  98. replace "NSArgumentInfo" with "NSArgumentInfo"
  99.     error "PR1toPR2Conversion: NSArgumentInfo has been replaced by specific methods"
  100. replace "NSArgumentInfo" with "NSArgumentInfo"
  101.     error "PR1toPR2Conversion: NSArgumentInfo has been replaced by specific methods"
  102. replace "NSBTreeCursor" with "NSBTreeCursor"
  103.     error "PR1toPR2Conversion: NSBTreeCursor has been removed"
  104. replace "NSBTreeBlock" with "NSBTreeBlock"
  105.     error "PR1toPR2Conversion: NSBTreeBlock has been removed"
  106. replace "NSHashStringLength" with "NSHashStringLength"
  107.     error "PR1toPR2Conversion: NSHashStringLength has been removed"
  108. replace "NSBTreeComparator" with "NSBTreeComparator"
  109.     error "PR1toPR2Conversion: NSBTreeComparator has been removed"
  110. replace "NSHashStringLength" with "NSHashStringLength"
  111.     error "PR1toPR2Conversion: NSHashStringLength has been removed"
  112. replace "NSByteStoreVersionException" with "NSByteStoreVersionException"
  113.     error "PR1toPR2Conversion: NSByteStoreVersionException has been removed"
  114. replace "NSByteStoreLockedException" with "NSByteStoreLockedException"
  115.     error "PR1toPR2Conversion: NSByteStoreLockedException has been removed"
  116. replace "NSByteStoreFile" with "NSByteStoreFile"
  117.     error "PR1toPR2Conversion: NSByteStoreFile has been removed"
  118. replace "NSByteStoreDamagedException" with "NSByteStoreDamagedException"
  119.     error "PR1toPR2Conversion: NSByteStoreDamagedException has been removed"
  120. replace "NSBundleLoaded" with "NSBundleLoaded"
  121.     error "PR1toPR2Conversion: NSBundleLoaded has been removed"
  122. replace "NSBTreeStoreKeyTooLargeException" with "NSBTreeStoreKeyTooLargeException"
  123.     error "PR1toPR2Conversion: NSBTreeStoreKeyTooLargeException has been removed"
  124. replace "NSByteStore" with "NSByteStore"
  125.     error "PR1toPR2Conversion: NSByteStore has been removed"
  126. replace "NSNotificationEvents" with "NSNotificationEvents"
  127.     error "PR1toPR2Conversion: NSNotificationEvents has been removed"
  128. replace "NSRecordAllocationEvent" with "NSRecordAllocationEvent"
  129.     error "PR1toPR2Conversion: NSRecordAllocationEvent has been removed"
  130. replace "NSRecordNotificationEvent" with "NSRecordNotificationEvent"
  131.     error "PR1toPR2Conversion: NSRecordNotificationEvent has been removed"
  132.  
  133.  
  134. /* changed API */
  135. replace "NSBecomingMultiThreaded" with "NSWillBecomeMultiThreadedNotification"
  136. replace "NSConnectionDeath" with "NSConnectionDidDieNotification"
  137. replace "NSCurrencyString" with "NSCurrencySymbol"
  138. replace "NSInternationalCurrencyString" with "NSInternationalCurrencySymbol"
  139. replace "NSFileGroupOwnerAccountNumber" with "NSFileGroupOwnerAccountName"
  140.     warning "PR1toPR2Conversion: NSFileGroupOwnerAccountName value is now a NSString instead of an NSNumber"
  141. replace "NSFileOwnerAccountNumber" with "NSFileOwnerAccountName"
  142.     warning "PR1toPR2Conversion: NSFileOwnerAccountName value is now a NSString instead of an NSNumber"
  143. replace "NSInvalidReceivePort" with "NSInvalidReceivePortException"
  144. replace "NSInvalidSendPort" with "NSInvalidSendPortException"
  145. replace "NSPPLBecameDirty" with "NSPPLDidBecomeDirtyNotification"
  146. replace "NSPPLSaved" with "NSPPLDidSaveNotification"
  147. replace "NSPortInvalidation" with "NSPortDidBecomeInvalidNotification"
  148. replace "NSPPLSaved" with "NSPPLDidSaveNotification"
  149. replace "NSPortReceiveError" with "NSPortReceiveException"
  150. replace "NSPortSendError" with "NSPortSendException"
  151. replace "NSPPLSaved" with "NSPPLDidSaveNotification"
  152. replace "NSPosixFileActivities" with "NSPosixFileActivity"
  153. replace "NSThreadExiting" with "NSThreadWillExitNotification"
  154. replace "NSUserDefaultsChanged" with "NSUserDefaultsDidChangeNotification"
  155. replace "NSThreadExiting" with "NSThreadWillExitNotification"
  156.  
  157.  
  158. /* method changes */
  159. replacemethod "<sel>" with same
  160.     error "PR1toPR2Conversion: <sel> is obsolete"
  161.     where "<sel>" isOneOf {
  162.     "signatureWithObjCTypes:",
  163.     "addRunLoopActivityMonitor:",
  164.     "bundleVersion",
  165.     "setBundleVersion:",
  166.     "stripAfterLoading:"
  167. }
  168.  
  169. replacemethod "argumentInfoAtIndex:" with same
  170.     error "PR1toPR2Conversion: use getArgumentTypeAtIndex: and friends instead"
  171. replacemethod "addYear:month:day:hour:minute:second:" with "dateByAddingYears:months:days:hours:minutes:seconds:"
  172. replacemethod "requestMode" with "requestModes"
  173.     warning "PR1toPR2Conversion: requestModes returns an NSArray"
  174. replacemethod "substringFromRange:" with "substringWithRange:"
  175. replacemethod "setRequestMode:" with "addRequestMode:"
  176. replacemethod "-performSelector:object:afterDelay:" with "performSelector:withObject:afterDelay:"
  177. replacemethod "perform:" with "performSelector:"
  178. replacemethod "perform:withObject:" with "performSelector:withObject:"
  179. replacemethod "perform:withObject:withObject:" with "performSelector:withObject:withObject:"
  180.  
  181.