home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / StreamConversion.tops < prev    next >
Encoding:
Text File  |  1996-01-23  |  4.4 KB  |  82 lines

  1. /*********** NSDataConversion: NXSelection ***********/
  2.  
  3. replace "[<selection> initWithDescription:<desc> length:-1]" with "[<selection> initWithDescriptionData:[NSData dataWithBytes:<desc> length:strlen(<desc>) + 1]]"
  4.  
  5. replacemethod "initWithDescription:<1> length:<2>" with "initWithDescriptionData:<1>" {
  6.     replace "<1_arg>" with "[NSData dataWithBytes:<1_arg> length:<2_arg>]"
  7.     replace "<1_type>" with "(NSData *)"
  8.     }
  9.  
  10. replace "[<selection> initWithDescriptionNoCopy:<desc> length:-1]" with "[<selection> initWithDescriptionData:[NSData dataWithBytes:<desc> length:strlen(<desc>) + 1]]"
  11.  
  12. replacemethod "initWithDescriptionNoCopy:<1> length:<2>" with "initWithDescriptionData:<1>" {
  13.     replace "<1_arg>" with "[NSData dataWithBytes:<1_arg> length:<2_arg>]"
  14.     replace "<1_type>" with "(NSData *)"
  15.     }
  16.  
  17. replace "<token bytes> = [<selection> descriptionOfLength:<length>];" with "<token bytes> = [[<selection> descriptionData] bytes];"
  18.  
  19. replacemethod "descriptionOfLength:<length>" with "descriptionData" {
  20.     replace "<rettype>" with "(NSData *)"
  21.     }
  22.     error "StreamConversion: 'descriptionData' returns an NSData instance (was 'descriptionOfLength:' returning 'const void *')"
  23.  
  24.  
  25. /*********** NSDataConversion: Pasteboard ***********/
  26.  
  27. replacemethod  "pasteboardByFilteringData:(NXData *)data ofType:(NSString *)type" with same {
  28.     replace "<data_type>" with "(NSData *)"
  29.     }
  30.     error "StreamConversion: 'pasteboardByFilteringData:ofType:' (used to be 'pasteboardByFilteringData:ofType:') now takes 'NSData *' as its first argument (used to take 'NXData *')."
  31.  
  32. replace "[<pboard> readType:NSStringPboardType data:<data> length:<length>]" with "<data> = [<pboard> stringForType:NSStringPboardType]"
  33.     error "StreamConversion: 'stringForType:' (used to be 'readType:data:length:') returns an NSString instance"
  34.  
  35. replace "[<pboard> writeType:NSStringPboardType data:<data> length:<length>]" with "[<pboard> setString:[NSString stringWithCString:<data> length:<length>] forType:NSStringPboardType]"
  36.  
  37. replace "[<pboard> readTypeToStream:NSStringPboardType]" with "<data> = [<pboard> stringForType:NSStringPboardType]"
  38.     error "StreamConversion: 'stringForType:' (used to be 'readTypeToStream:') returns an NSString instance (used to return an NXStream)"
  39.  
  40. replace "[<pboard> writeType:NSStringPboardType fromStream:<stream>]" with "[<pboard> setString:<stream> forType:NSStringPboardType]"
  41.     error "StreamConversion: 'setString:forType:' (used to be 'writeType:fromStream:') takes NSString instance (used to take an NXStream)"
  42.  
  43. replacemethod "readType:data:<2> length:<3>" with "dataForType:" {
  44.     replace "<rettype>" with "(NSData *)"
  45.     replace "<call>" with "<2_arg> = <call>"
  46.     }
  47.     error "StreamConversion: 'dataForType:' (used to be 'readType:data:length:') returns an NSData instance"
  48.  
  49. replacemethod "readTypeToStream:<type>" with "dataForType:<type>" {
  50.     replace "<rettype>" with "(NSData *)"
  51.     }
  52.     error "StreamConversion: 'dataForType:' (used to be 'readTypeToStream:') returns an NSData instance (used to return NXStream)."
  53.  
  54. replacemethod "writeType:<1> data:<2> length:<3>" with "setData:<2> forType:<1>" {
  55.     replace "<rettype>" with "(BOOL)"
  56.     replace "<2_type>" with "(NSData *)"
  57.     replace "<2_arg>" with "[NSData dataWithBytes:<2_arg> length:<3_arg>]"
  58.     }
  59.    
  60. replacemethod "writeType:<1> fromStream:<2>" with "setData:<2> forType:<1>" {
  61.     replace "<rettype>" with "(BOOL)"
  62.     replace "<2_type>" with "(NSData *)"
  63.     }
  64.     error "StreamConversion: 'setData:forType:' (used to be 'writeType:fromStream:') takes an NSData instance as its first argument (used to take NXStream)."
  65.  
  66. replacemethod "deallocatePasteboardData:length:" with same
  67.     error "StreamConversion: 'deallocatePasteboardData:length:' no longer exists and never needs to be called"
  68.  
  69. replace "NSFilenamesPboardType" with same
  70.     error "StreamConversion: NSFilenamesPboardType used to be NXFilenamePboardType. Pasteboard data of type NSFilenamesPboardType will be an NSArray of NSString. Use 'setPropertyList:forType:' and 'propertyListForType:'"
  71.  
  72.   
  73. /*********** NSDataConversion: View and Window ***********/
  74.  
  75. replacemethod "copyPSCodeInside:<1>to:<2>" with "dataWithEPSInsideRect:<1>" {
  76.     replace "<rettype>" with "(NSData *)"
  77.     replace "<call>" with "<2_arg> = <call>;"
  78.     }
  79.     error "StreamConversion: 'dataWithEPSInsideRect:' (used to be 'copyPSCodeInside:to:') returns an NSData instance (used to recieve an NXStream)"
  80.  
  81.  
  82.