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

  1. /*********** InterfaceBuilder.h tops conversion script ***********/
  2.  
  3. replace "\<apps/InterfaceBuilder.h>" with "<InterfaceBuilder/InterfaceBuilder.h>"
  4. replace "\<Apps/InterfaceBuilder.h>" with "<InterfaceBuilder/InterfaceBuilder.h>"
  5.  
  6. replacemethod "<sel>" with same {
  7.     replace "<notification_type>" with "(NSNotification *)"
  8.     replace "<notification_param>" with "notification"
  9.     replace "<implementation>" with "id <IBDocuments> *aDocument = [notification object];
  10.     <implementation>"
  11.     }
  12.     within ("<implementation>") {
  13.     replace "<notification_param>" with "aDocument"
  14.     }
  15.     where "<sel>" isOneOf {
  16.     "didOpenDocument:<notification>",
  17.     "willSaveDocument:<notification>",
  18.     "didSaveDocument:<notification>",
  19.     }
  20.  
  21. replace "- <mtype rettype> <b old>" with "<b new>"
  22.     where ("<old>", "<new>") isOneOf {
  23.         ("didOpenDocument:", "- (void)didOpenDocument:")
  24.     ("willSaveDocument:", "- (void)willSaveDocument:")
  25.     ("didSaveDocument:", "- (void)didSaveDocument:")
  26.     ("finishInstantiate", "- (void)finishInstantiate")
  27.     }
  28.  
  29. replacemethod "<sel>" with same {
  30.         replace "<rettype>" with "(void)"
  31.     } within ("<implementation>") {
  32.         replace "return self;" with "return;"
  33.         replace "return super;" with "return;"
  34.         replace "return (self)" with "return;"
  35.     } where "<sel>" isOneOf {
  36.         "didOpenDocument:"
  37.         "willSaveDocument:"
  38.         "didSaveDocument:"
  39.     "finishInstantiate"
  40.     }
  41.  
  42. replacemethod "<sel>" with same {
  43.         replace "<rettype>" with "(NSString *)"
  44.     } within ("<implementation>") {
  45.         replace "return <s value>;" with "return [NSString stringWithCString:<value>];"
  46.     } where "<sel>" isOneOf {
  47.         "getInspectorClassName"
  48.     "getConnectInspectorClassName"
  49.     "getSizeInspectorClassName"
  50.     "getHelpInspectorClassName"
  51.     "getEditorClassName"
  52.     }
  53.  
  54. replace "getInspectorClassName" with "inspectorClassName"
  55.  
  56. replace "getConnectInspectorClassName" with "connectInspectorClassName"
  57.  
  58. replace "getSizeInspectorClassName" with "sizeInspectorClassName"
  59.  
  60. replace "getHelpInspectorClassName" with "helpInspectorClassName"
  61.  
  62. replace "getEditorClassName" with "editorClassName"
  63.  
  64. replace "getIBImage" with "imageForViewer"
  65.  
  66. replace "[<palette> associateObject:<obj> type:<type> with:<view>]" with "[<palette> associateObject:<obj> ofType:<type> withView:<view>]"
  67.  
  68. replacemethod "initWith:inDocument:" with "editObject:inDocument:"
  69.  
  70. replace "[<editor> initWith:<object> inDocument:<document>]" with "[<editor> editObject:<object> inDocument:<document>]"
  71.  
  72. replace "redrawSelection" with "drawSelection"
  73.  
  74. replacemethod "renewObject:to:" with "replaceObject:withObject:"
  75.  
  76. replace "@implementation<w w1><isKindOf(IBInspector) class><w w2><any code><w w3>@end" with same
  77.     within ("<code>") {
  78.         replace "object" with "[self object]"
  79.         replace "window" with "[self window]"
  80.         replace "okButton" with "[self okButton]"
  81.         replace "revertButton" with "[self revertButton]"
  82.     replace "[self [self object]]" with "[self object]"
  83.     replace "[self [self window]]" with "[self window]"
  84.     replace "[self [self okButton]]" with "[self okButton]"
  85.     replace "[self [self revertButton]]" with "[self revertButton]"
  86.     replace "- <mtype rettype> <b old>" with "<b new>"
  87.         where ("<old>", "<new>") isOneOf {
  88.         ("ok:", "- (void)ok:")
  89.         ("revert:", "- (void)revert:")
  90.         }
  91.         replacemethod "<sel>" with same {
  92.             replace "<rettype>" with "(void)"
  93.         } within ("<implementation>") {
  94.             replace "return <retvalue>;" with "<retvalue>; return;"
  95.         } where "<sel>" isOneOf {
  96.             "ok:"
  97.             "revert:"
  98.         }
  99. }
  100.  
  101. replace "@interface<w w1><isKindOf(IBInspector) class><w w2><any code><w w3>@end" with same
  102.     within ("<code>") {
  103.     replace "- <mtype rettype> <b old>" with "<b new>"
  104.         where ("<old>", "<new>") isOneOf {
  105.         ("ok:", "- (void)ok:")
  106.         ("revert:", "- (void)revert:")
  107.         }
  108. }
  109.