home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / RectConversion.tops < prev    next >
Encoding:
Text File  |  1996-08-30  |  37.6 KB  |  1,008 lines

  1.  
  2. /*********** RectConversion: Functions *************/
  3.  
  4. replace "NXEmptyRect(<b arg1>)" with "NSIsEmptyRect(*<b arg1>)"
  5.  
  6. replace "NXDivideRect(<b arg1> , <b arg2> , <b rest>)" with "NSDivideRect(*<b arg1> , <b arg2> , <b arg1> , <b rest>)"
  7.  
  8. replace "NXUnionRect(<b arg1> , <b arg2>)" with "*<b arg2>  = NSUnionRect(*<b arg1> , *<b arg2>)"
  9.  
  10. replace "NXContainRect" with "NXContainsRect"
  11.  
  12. replace "NXContainsRect(<b arg1> , <b arg2>)" with "NSContainsRect(*<b arg1> , *<b arg2>)"
  13.  
  14. replace "NXCopyBitmapFromGState(<b arg1> , <b arg2> , <b arg3>)" with "NSCopyBitmapFromGState(<b arg1> , *<b arg2> , *<b arg3>)"
  15.  
  16. replace "NXCopyBits(<b arg1> , <b arg2> , <b arg3>)" with "NSCopyBits(<b arg1> , *<b arg2> , *<b arg3>)"
  17.  
  18. replace "NXDrawBitmap(<b arg1> , <b rest>)" with "NSDrawBitmap(*<b arg1> , <b rest>)"
  19.  
  20. replace "NXDrawButton(<t arg1>, NULL)" with "NSDrawButton(*<t arg1>, *<t arg1>)"
  21.  
  22. replace "NXDrawGrayBezel(<t arg1>, NULL)" with "NSDrawGrayBezel(*<t arg1>, *<t arg1>)"
  23.  
  24. replace "NXDrawGroove(<t arg1>, NULL)" with "NSDrawGroove(*<t arg1>, *<t arg1>)"
  25.  
  26. replace "NXDrawWhiteBezel(<t arg1>, NULL)" with "NSDrawWhiteBezel(*<t arg1>, *<t arg1>)"
  27.  
  28. replace "NXDrawTiledRects(<t arg1>, NULL, <b rest>)" with "NSDrawTiledRects(*<t arg1>, *<t arg1>, <t rest>)"
  29.  
  30. replace "<t function>(<b arg1> , NULL)" with "<t function>(*<b arg1> , *<b arg1>)"
  31.     warning "RectConversion: <t function> is sending first argument as clipping rect (second argument). Make sure re-evaluation of the expression isnt harmful"
  32.     where "<function>" isOneOf {
  33.     "NXDrawButton",
  34.     "NXDrawGrayBezel",
  35.     "NXDrawGroove",
  36.     "NXDrawWhiteBezel"
  37.     }
  38.  
  39. replace "NXDrawTiledRects(<b arg1> , NULL, <b rest>)" with "NSDrawTiledRects(*<b arg1> , *<b arg1> , <b rest>)"
  40.     warning "RectConversion: NXDrawTiledRects is sending first argument as clipping rect (second argument).  Make sure re-evaluation of the expression isnt harmful"
  41.  
  42. replace "NXDrawButton(<b arg1> , <b arg2>)" with "NSDrawButton(*<b arg1> , *<b arg2>)"
  43.  
  44. replace "NXDrawGrayBezel(<b arg1> , <b arg2>)" with "NSDrawGrayBezel(*<b arg1> , *<b arg2>)"
  45.  
  46. replace "NXDrawGroove(<b arg1> , <b arg2>)" with "NSDrawGroove(*<b arg1> , *<b arg2>)"
  47.  
  48. replace "NXDrawWhiteBezel(<b arg1> , <b arg2>)" with "NSDrawWhiteBezel(*<b arg1> , *<b arg2>)"
  49.  
  50. replace "NXDrawTiledRects(<b arg1> , <b arg2> , <b rest>)" with "*<b arg1>  = NSDrawTiledRects(*<b arg1> , *<b arg2> , <b rest>)"
  51.  
  52. replace "NXEqualRect(<b arg1> , <b arg2>)" with "NSEqualRects(*<b arg1> , *<b arg2>)"
  53.  
  54. replace "NXEraseRect(<b arg1>)" with "NSEraseRect(*<b arg1>)"
  55.  
  56. replace "NXFrameLinkRect(<b arg1> , <b arg2>)" with "NSFrameLinkRect(*<b arg1> , <b arg2>)"
  57.  
  58. replace "NXFrameRect(<b arg1>)" with "NSFrameRect(*<b arg1>)"
  59.  
  60. replace "NXFrameRectWithWidth(<b arg1> , <b arg2>)" with "NSFrameRectWithWidth(*<b arg1> , <b arg2>)"
  61.  
  62. replace "NXHighlightRect(<b arg1>)" with "NSHighlightRect(*<b arg1>)"
  63.  
  64. replace "NXInsetRect(<b arg1> , <b arg2> , <b arg3>)" with "*<b arg1> = NSInsetRect(*<b arg1> , <b arg2> , <b arg3>)"
  65.  
  66. replace "NXIntegralRect(<b arg1>)" with "*<b arg1> = NSIntegralRect(*<b arg1>)"
  67.  
  68. replace "(<b start><w w>NXIntersectionRect(<b arg1> , <b arg2>)" with "(<b start><w w>!NSIsEmptyRect(*<b arg2> = NSIntersectionRect(*<b arg1> , *<b arg2>))"
  69.  
  70. replace "NXIntersectionRect(<b arg1> , <b arg2>)" with "*<b arg2> = NSIntersectionRect(*<b arg1> , *<b arg2>)"
  71.  
  72. replace "NXIntersectsRect(<b arg1> , <b arg2>)" with "!NSIsEmptyRect(NSIntersectionRect(*<b arg1> , *<b arg2>))"
  73.  
  74. replace "NXMouseInRect(<b arg1> , <b arg2> , <b arg3>)" with "NSMouseInRect(*<b arg1> , *<b arg2> , <b arg3>)"
  75.  
  76. replace "NXOffsetRect(<b arg1> , <b arg2> , <b arg3>)" with "*<b arg1> = NSOffsetRect(*<b arg1> , <b arg2> , <b arg3>)"
  77.  
  78. replace "NXPointInRect(<b arg1> , <b arg2>)" with "NSPointInRect(*<b arg1> , *<b arg2>)"
  79.  
  80. replace "NXReadPixel(<b arg1>)" with "NSReadPixel(*<b arg1>)"
  81.  
  82. replace "NXRectClip(<b arg1>)" with "NSRectClip(*<b arg1>)"
  83.  
  84. replace "NXRectClipList(<b arg1> , <b arg2>)" with "NSRectClipList(<b arg1> , <b arg2>)"
  85.  
  86. replace "NXRectFill(<b arg1>)" with "NSRectFill(*<b arg1>)"
  87.  
  88. replace "NXRectFillList(<b args>)" with "NSRectFillList(<b args>)"
  89.  
  90. replace "NXRectFillListWithGrays(<b args>)" with "NSRectFillListWithGrays(<b args>)"
  91.  
  92. replace "NXSetRect(<b arg1> , <b arg2> , <b arg3> , <b arg4> , <b arg5>)" with "*<b arg1> = NSMakeRect(<b arg2>, <b arg3>, <b arg4>, <b arg5>)"
  93.  
  94. replace "NXFindPaperSize(<b arg1>)" with "NXFindPaperSize(<b arg1>)"
  95.     warning "RectConversion:  NXFindPaperSize (will become [NSPrintInfo sizeForPaperName:<arg1>]) now returns (NSSize) instead of (NXSize *)"
  96.  
  97. replace "NXLinkFrameThickness(<b arg1>)" with "NSLinkFrameThickness(<b arg1>)"
  98.  
  99. /*********** RectConversion: Macros *************/
  100.  
  101. replace "NX_XMIN" with "NSMinXEdge"
  102.  
  103. replace "NX_YMIN" with "NSMinYEdge"
  104.  
  105. replace "NX_XMAX" with "NSMaxXEdge"
  106.  
  107. replace "NX_YMAX" with "NSMaxYEdge"
  108.  
  109. replace "NX_MAXX(<arg>)" with "NSMaxX(*<arg>)"
  110.  
  111. replace "NX_MAXY(<arg>)" with "NSMaxY(*<arg>)"
  112.  
  113. replace "NX_MIDX(<arg>)" with "NSMidX(*<arg>)"
  114.  
  115. replace "NX_MIDY(<arg>)" with "NSMidY(*<arg>)"
  116.  
  117. replace "NXCoord" with "float"
  118.  
  119. /* first 4 rules are for token args, second 4 are for arbitrary expressions */
  120.  
  121. replace "NX_X(<t arg>) <t op> <expr>" with "<arg>->origin.x <op> <expr>"
  122.     where "<op>" isOneOf {
  123.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  124.     }
  125.  
  126. replace "NX_Y(<t arg>) <t op> <expr>" with "<arg>->origin.y <op> <expr>"
  127.     where "<op>" isOneOf {
  128.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  129.     }
  130.  
  131. replace "NX_WIDTH(<t arg>) <t op> <expr>" with "<arg>->size.width <op> <expr>"
  132.     where "<op>" isOneOf {
  133.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  134.     }
  135.  
  136. replace "NX_HEIGHT(<t arg>) <t op> <expr>" with "<arg>->size.height <op> <expr>"
  137.     where "<op>" isOneOf {
  138.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  139.     }
  140.  
  141.  
  142. replace "NX_X(<arg>) <t op> <expr>" with "(<arg>)->origin.x <op> <expr>"
  143.     where "<op>" isOneOf {
  144.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  145.     }
  146.  
  147. replace "NX_Y(<arg>) <t op> <expr>" with "(<arg>)->origin.y <op> <expr>"
  148.     where "<op>" isOneOf {
  149.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  150.     }
  151.  
  152. replace "NX_WIDTH(<arg>) <t op> <expr>" with "(<arg>)->size.width <op> <expr>"
  153.     where "<op>" isOneOf {
  154.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  155.     }
  156.  
  157. replace "NX_HEIGHT(<arg>) <t op> <expr>" with "(<arg>)->size.height <op> <expr>"
  158.     where "<op>" isOneOf {
  159.     "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>="
  160.     }
  161.  
  162. replace "NX_X(<arg>)" with "NSMinX(*<arg>)"
  163.  
  164. replace "NX_Y(<arg>)" with "NSMinY(*<arg>)"
  165.  
  166. replace "NX_WIDTH(<arg>)" with "NSWidth(*<arg>)"
  167.  
  168. replace "NX_HEIGHT(<arg>)" with "NSHeight(*<arg>)"
  169.  
  170. /*********** RectConversion: 'calcUpdateRects::::' exception *************/
  171.  
  172. replacemethod "calcUpdateRects::::" with same
  173.     error "RectConversion: calcUpdateRects is obsolete.  The display mechanism always just operates on one rect, instead of the previous list of three."
  174.  
  175. /*********** RectConversion: 'trackMouse:inRect:ofView:' exception *************/
  176.  
  177. replace "[<obj> trackMouse:<event> inRect:<NULL> ofView:<view>]" with "[<obj> trackMouse:<event> inRect:??? ofView:<view> untilMouseUp:YES]"
  178.     error "RectConversion: 'trackMouse:inRect:ofView:untilMouseUp:' (used to be 'trackMouse:inRect:ofViewinRect:') should receive cells bounds for 'inRect:'"
  179.     where "<NULL>" isOneOf {
  180.     "NULL",
  181.     "nil",
  182.     "(NXRect *)0"
  183.     }
  184.  
  185. replacemethod "trackMouse:inRect:<rect> ofView:" with "trackMouse:inRect:<rect> ofView:untilMouseUp:<mouseup>" {
  186.     replace "<rect_type>" with "(NSRect)"
  187.     replace "<rect_arg>" with "*<rect_arg>"
  188.     replace "<mouseup_type>" with "(BOOL)"
  189.     replace "<mouseup_param>" with "_untilMouseUp"
  190.     }
  191.     warning "RectConversion: 'trackMouse:inRect:ofView:untilMouseUp:' used to be 'trackMouse:inRect:ofView:'.  untilMouseUp == YES when inRect used to be NULL"
  192.     within ("<implementation>") {
  193.     replace "<rect_param>->" with "*<rect_param>."
  194.     replace "<rect_param>" with "&<rect_param>" 
  195.     replace "!&<rect_param>" with "untilMouseUp"
  196.     replace "|| &<rect_param>" with "|| !untilMouseUp"
  197.     replace "&& &<rect_param>" with "&& !untilMouseUp"
  198.     replace "if (&<rect_param>" with "if (!untilMouseUp"
  199.     replace "while (&<rect_param>" with "while (!untilMouseUp"
  200.     replace "for (<b init>; &<rect_param>" with "for (<b init>; !untilMouseUp"
  201.     }
  202.         
  203. /*********** RectConversion: NUUL rect exceptions *************/
  204.  
  205. replace "[<rec> titleWidth:NULL]" with "[<rec> titleWidth]"
  206.  
  207. replace "[<rec> composite:<op> fromRect:NULL toPoint:<point>]" with "[<rec> composite:<op> toPoint:<point>]"
  208.  
  209. replace "[<rec> copyPSCodeInside:NULL to:<stream>]" with "[<rec> copyPSCodeInside:&[<rec> bounds] to:<stream>]"
  210.  
  211. replace "[<rec> dissolve:<delta> fromRect:NULL toPoint:<point>]" with "[<rec> dissolve:<delta> toPoint:<point>]"
  212.  
  213. replace "[<rec> initContent:NULL style:<style> backing:<bufType> buttonMask:<mask> defer:<flag>]" with "[<rec> initContent:&NSMakeRect(100.0, 100.0, 100.0, 100.0) style:<style> backing:<bufType> buttonMask:<mask> defer:<flag>]"
  214.  
  215. replace "[<rec> newContent:NULL style:<style> backing:<bufType> buttonMask:<mask> defer:<flag>]" with "[<rec> initContent:&NSMakeRect(100.0, 100.0, 100.0, 100.0) style:<style> backing:<bufType> buttonMask:<mask> defer:<flag>]"
  216.  
  217. replace "[<rec> writePSCodeInside:NULL to:<pboard>]" with "[<rec> writePSCodeInside:&[<rec> bounds] to:<pboard>]"
  218.  
  219. /*********** RectConversion: Displaying exceptions *************/
  220.  
  221. replace "[<obj> <b old>]" with "[<obj> <b new>]"
  222.     where ("<old>", "<new>") isOneOf {
  223.     ("drawSelf:<rects> :1", "drawRect:*<rects>"),
  224.     ("display:<rects> :1", "displayRect:*<rects>"),
  225.     ("display:<rects> :0", "display]"),
  226.     ("display:<rects> :1 :<clip>]", "displayRect:*<rects>"),
  227.     ("display:<rects> :0 :<clip>]", "displayRect:[<obj> bounds]"),
  228.     ("displayFromOpaqueAncestor:<rects> :1 :<clip>", "displayRect:*<rects>"),
  229.     ("displayFromOpaqueAncestor:<rects> :0 :<clip>", "displayRect:[<obj> bounds]"),
  230.     ("invalidate:<rects> :1]", "invalidate:*<rects>")
  231.     }
  232.     
  233. /* rename for consitency */
  234. replacemethod "drawSelf:" with "drawRect:"
  235.  
  236. replacemethod "<old>" with "<new>" {
  237.     replace "<rect_type>" with "(NSRect)"
  238.     replace "<rect_arg>" with "*<rect_arg>"
  239.     }
  240.     within ("<implementation>") {
  241.     replace "<rect_param>->" with "*<rect_param>."
  242.     replace "<rect_param>" with "&<rect_param>"
  243.     }
  244.     warning "RectConversion: <new> (used to be <old>) no longer takes an array of rects"
  245.     where ("<old>", "<new>") isOneOf {
  246.     ("drawSelf:<rect>:", "drawRect:<rect>"),
  247.     ("display:<rect>:", "displayRect:<rect>"),
  248.     ("display:<rect>::", "displayRect:<rect>"),
  249.     ("displayFromOpaqueAncestor:<rect>::<3>", "displayRect:<rect>"),
  250.     ("invalidate:<rect>:", "invalidate:<rect>")
  251.     }
  252.     
  253. replace "CONVERSIONdisplay" with "display"
  254.     
  255. /*********** RectConversion: Convert one rect parameter, change return value from id to NSRect *************/
  256.  
  257. replacemethod "<old>" with "<new>" {
  258.     replace "<rettype>" with "(NSRect)"
  259.     replace "<rect_type>" with "(NSRect)"
  260.     replace "<rect_arg>" with "*<rect_arg>"
  261.     replace "<call>" with "*<rect_arg> = <call>"
  262.     }
  263.     within ("<implementation>") {
  264.     replace "<rect_param>->" with "*<rect_param>."
  265.     replace "<rect_param>" with "&<rect_param>"
  266.     replace "return self;" with "return <rect_param>;" 
  267.     replace "return (self);" with "return (<rect_param>);"
  268.     replace "return NULL;" with "return NSZeroRect;"
  269.     replace "return (NULL);" with "return (NSZeroRect);"
  270.     replace "return nil;" with "return NSZeroRect;"
  271.     replace "return (nil);" with "return (NSZeroRect);"
  272.     }
  273.     where ("<old>", "<new>" ) isOneOf {
  274.     ("getIconRect:<rect>", "iconRectForBounds:<rect>"),
  275.     ("getTitleRect:<rect>", "titleRectForBounds:<rect>"),
  276.     ("getDrawRect:<rect>", "drawingRectForBounds:<rect>"),
  277.     ("constrainFrameRect:<rect> toScreen:", "constrainFrameRect:<rect> toScreen")
  278.     }
  279.     
  280. replacemethod "<old>" with "<new>" {
  281.     replace "<rettype>" with "(NSRect)"
  282.     replace "<rect_type>" with "(NSRect)"
  283.     replace "<rect_arg>" with "*<rect_arg>"
  284.     replace "<call>" with "*<rect_arg> = <call>"
  285.     replace "<implementation>" with "
  286.     NSRect <rect_param>;
  287.     <implementation>"
  288.     }
  289.     within ("<implementation>") {
  290.     replace "<rect_param>->" with "*<rect_param>."
  291.     replace "<rect_param>" with "&<rect_param>"
  292.     replace "return self;" with "return <rect_param>;" 
  293.     replace "return (self);" with "return (<rect_param>);"
  294.     replace "return NULL;" with "return NSZeroRect;"
  295.     replace "return (NULL);" with "return (NSZeroRect);"
  296.     replace "return nil;" with "return NSZeroRect;"
  297.     replace "return (nil);" with "return (NSZeroRect);"
  298.     }
  299.     where ("<old>", "<new>" ) isOneOf {
  300.     ("getParagraph:start:end:rect:<rect>", "paragraphRect:start:end:"),
  301.     ("getKnobRect:<rect> flipped:<2>", "knobRectFlipped:<2>"),
  302.     ("getFrame:<rect>", "frame"),
  303.     ("getDocVisibleRect:<rect>", "documentVisibleRect"),
  304.     ("getDocRect:<rect>", "documentRect"),
  305.     ("getButtonFrame:<rect>", "buttonFrame"),
  306.     ("getBounds:<rect>", "bounds"),
  307.     ("getBoundingBox:<rect>", "boundingBox"),
  308.     ("getCellFrame:<rect>at:<2>:<3>", "cellFrameAt:<2>:<3>"),
  309.     }
  310.     
  311. /*********** RectConversion: 'constrainFrameRect' excpetion *************/
  312.  
  313. replace "[<obj> constrainFrameRect:<rect> toScreen:<screen>]" with same
  314.     warning "RectConversion: 'constrainFrameRect:toScreen' ; might need to check if rect was changed"
  315.  
  316. /*********** RectConversion: Call exceptions for return value converted from ptr/null to BOOL *************/
  317.  
  318. replace "(<b start><w w1>[<obj> <b old>]<w w2><b end>)" with "(<b start><w w1>!NSIsEmptyRect(*<rect> = [<obj> <b new>])<w w2><b end>)"
  319.     where ("<old>", "<new>") isOneOf {
  320.     ("getTitleFrame:<rect> ofColumn:<2>", "titleFrameOfColumn:<2>"),
  321.     ("getFrame:<rect>ofInsideOfColumn:<2>", "frameOfInsideOfColumn:<2>"),
  322.     ("getFrame:<rect> ofColumn:<2>", "frameOfColumn:<2>"),
  323.     ("calcRect:<rect> forPart:<2>", "rectForPart:<2>"),
  324.     ("getVisibleRect:<rect>", "visibleRect")
  325.     }
  326.  
  327.  
  328. /*********** RectConversion: Convert return type from BOOL to NSRect *************/
  329.  
  330. replacemethod "<old>" with "<new>" {
  331.     replace "<rettype>" with "(NSRect)"
  332.     replace "<call>" with "*<rect_arg> = <call>"
  333.     replace "<implementation>" with "
  334.     NSRect <rect_param>;
  335.     <implementation>"
  336.     }
  337.     within ("<implementation>") {
  338.     replace "<rect_param>->" with "*<rect_param>."
  339.     replace "<rect_param>" with "&<rect_param>"
  340.     replace "return YES;" with "return <rect_param>;" 
  341.     replace "return (YES);" with "return (<rect_param>);"
  342.     replace "return NO;" with "return NSZeroRect;"
  343.     replace "return (NO);" with "return (NSZeroRect);"
  344.     }
  345.     where ("<old>", "<new>") isOneOf {
  346.     ("getVisibleRect:<rect>", "visibleRect"),
  347.     ("getRect:<rect> forPage:<2>", "rectForPage:<2>")
  348.     }
  349.        
  350. /*********** RectConversion: Convert return type from NXRect * to NSRect and return first param *************/
  351.  
  352. replacemethod "<old>" with "<new>" {
  353.     replace "<rettype>" with "(NSRect)"
  354.     replace "<call>" with "<rect_arg> = <call>"
  355.     replace "<implementation>" with "
  356.     NSRect <rect_param>;
  357.     <implementation>"
  358.     }
  359.     within ("<implementation>") {
  360.     replace "<rect_param>->" with "*<rect_param>."
  361.     replace "<rect_param>" with "&<rect_param>"
  362.     replace "return <exp>;" with "return *<exp>;"
  363.     }
  364.     where ("<old>", "<new>") isOneOf {
  365.     ("getTitleFrame:<rect> ofColumn:<2>", "titleFrameOfColumn:<2>"),
  366.     ("getFrame:<rect>ofInsideOfColumn:<2>", "frameOfInsideColumn:<2>"),
  367.     ("getFrame:<rect>ofColumn:<2>", "frameOfColumn:<2>"),
  368.     ("calcRect:<rect>forPart:<2>", "rectForPart:<2>")
  369.     }    
  370.  
  371. /*********** RectConversion: Convert one rect param (type only) *************/
  372.  
  373. replacemethod "getImage:rect:<rect>" with same {
  374.     replace "<rect_type>" with "(NSRect *)"
  375.     }
  376.  
  377. replacemethod "getFrame:<rect> andScreen:" with same {
  378.     replace "<rect_type>" with "(NSRect *)"
  379.     }
  380.  
  381. replacemethod "getWindow:andRect:<rect>" with same {
  382.     replace "<rect_type>" with "(NSRect *)"
  383.     }
  384.  
  385. /*********** RectConversion: Convert two rect params *************/
  386.  
  387. replacemethod "resizeText:<rect1>:<rect2>" with same {
  388.     replace "<rect1_type>" with "(NSRect)"
  389.     replace "<rect1_arg>" with "*<rect_arg>"
  390.     replace "<rect2_type>" with "(NSRect)"
  391.     replace "<rect2_arg>" with "*<rect_arg>"
  392.     }
  393.     within ("<implementation>") {
  394.     replace "<rect1_param>->" with "*<rect1_param>."
  395.     replace "<rect1_param>" with "&<rect1_param>"
  396.     replace "<rect2_param>->" with "*<rect2_param>."
  397.     replace "<rect2_param>" with "&<rect2_param>"
  398.     }
  399.  
  400. /*********** RectConversion: Convert one of two rect params, return other *************/
  401.  
  402. replacemethod "<old>" with "<new>" {
  403.     replace "<rettype>" with "(NSRect)"
  404.     replace "<rect1_type>" with "(NSRect)"
  405.     replace "<rect1_arg>" with "*<rect1_arg>"
  406.     replace "<call>" with "*<rect2_arg> = <call>"
  407.     replace "<implementation>" with "
  408.     NSRect <rect2_param>;
  409.     <implementation>"
  410.     }
  411.     within ("<implementation>") {
  412.     replace "<rect1_param>->" with "*<rect1_param>."
  413.     replace "<rect1_param>" with "&<rect1_param>"
  414.     replace "<rect2_param>->" with "*<rect2_param>."
  415.     replace "<rect2_param>" with "&<rect2_param>"
  416.     replace "return self" with "return <rect2_param>"
  417.     replace "return (self)" with "return (<rect2_param>)"
  418.     }
  419.     where ("<old>", "<new>") isOneOf {
  420. /*+*/    ("getContentRect:<rect2>forFrameRect:<rect1>style:<3>" "contentRectForFrameRect:<rect1>style:<3>"),
  421. /*+*/    ("getFrameRect:<rect2>forContentRect:<rect1>style:<3>", "frameRectForContentRect:<rect1> style:<3>")
  422.     }
  423.  
  424. replacemethod "<old>" with "<new>" {
  425.     replace "<rettype>" with "(NSRect)"
  426.     replace "<rect1_type>" with "(NSRect)"
  427.     replace "<rect1_arg>" with "*<rect1_arg>"
  428.     replace "<call>" with "*<rect2_arg> = <call>"
  429.     replace "<implementation>" with "
  430.     NSRect <rect2_param>;
  431.     <implementation>"
  432.     }
  433.     within ("<implementation>") {
  434.     replace "<rect1_param>->" with "*<rect1_param>."
  435.     replace "<rect1_param>" with "&<rect1_param>"
  436.     replace "<rect2_param>->" with "*<rect2_param>."
  437.     replace "<rect2_param>" with "&<rect2_param>"
  438.     replace "<rect2_param>" with same
  439.         error "RectConversion: <rect2_param> is no longer passed in to this method"
  440.     replace "return self" with "return <rect2_param>"
  441.     replace "return (self)" with "return (<rect2_param>)"
  442.     }
  443.     where ("<old>", "<new>") isOneOf {
  444.     ("textDidResize:oldBounds:<rect1>invalid:<rect2>", "textDidResize:oldBounds:<rect1>"),
  445.     }
  446.  
  447. /*********** RectConversion: Convert return type from NXRect to NSRect *************/
  448.  
  449. replacemethod "<sel>" with same {
  450.     replace "<rettype>" with "(NSRect)"
  451.     }
  452.     where "<sel>" isOneOf {
  453.     "imageRectForPaper:"
  454.     "rectForKey:inTable:"
  455.     }
  456.     
  457. /*********** RectConversion: Convert return type from NXRect* to NSRect *************/
  458.  
  459. replacemethod "paperRect" with "paperRect" {
  460.     replace "<rettype>" with "(NSRect)"
  461.     replace "<call>" with "*<call>"
  462.     }
  463.     within ("<implementation>"){
  464.     replace "return <exp>;" with "return *<exp>;"
  465.     }
  466.  
  467. /*********** RectConversion: Convert one rect param *************/
  468.  
  469. replacemethod "<sel>" with same {
  470.     replace "<rect_type>" with "(NSRect)"
  471.     replace "<rect_arg>" with "*<rect_arg>"
  472.     }
  473.     within ("<implementation>") {
  474.     replace "<rect_param>->" with "*<rect_param>."
  475.     replace "<rect_param>" with "&<rect_param>"
  476.     }
  477.     where "<sel>" isOneOf {
  478. /*+*/    "newContent:<rect>style:backing:buttonMask:defer:",
  479. /*+*/    "newContent:<rect>style:backing:buttonMask:defer:screen:",
  480. /*+*/    "newFrame:<rect>",
  481. /*+*/    "newFrame:<rect>icon:tag:target:action:key:enabled:",
  482. /*+*/    "newFrame:<rect>mode:cellClass:numRows:numCols:",
  483. /*+*/    "newFrame:<rect>mode:prototype:numRows:numCols:",
  484. /*+*/    "newFrame:<rect>text:alignment:",
  485. /*+*/    "newFrame:<rect>title:tag:target:action:key:enabled:",
  486. /*+*/    "newFromImage:rect:<rect>",
  487. /*+*/    "newFromWindow:rect:<rect>",
  488. /*+*/    "newRect:<rect>type:window:",
  489. /*+*/    "readImage:<rect>into:",
  490. /*+*/    "sizeImage:<rect>",
  491. /*+*/    "sizeImage:<rect>pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpace:",
  492.     "addCursorRect:<rect>cursor:",
  493.     "addCursorRect:<rect>cursor:forView:",
  494.     "adjustScroll:<rect>",
  495.     "beginPage:label:bBox:<rect>fonts:",
  496.     "beginPrologueBBox:<rect>creationDate:createdBy:fonts:forWhom:pages:title:",
  497.     "calcDrawInfo:<rect>",
  498.     "centerScanRect:<rect>",
  499.     "clearTitleInRect:<rect>ofColumn:",
  500.     "clipToFrame:<rect>",
  501.     "convertRect:<rect>fromView:",
  502.     "convertRect:<rect>toView:",
  503.     "convertRectFromSuperview:<rect>",
  504.     "convertRectToSuperview:<rect>",
  505.     "copyPSCodeInside:<rect>to:",
  506.     "dragFile:fromRect:<rect>slideBack:event:",
  507.     "drawBarInside:<rect>flipped:",
  508.     "drawDivider:<rect>",
  509.     "drawIn:<rect>",
  510.     "drawInside:<rect>inView:",
  511.     "drawKnob:<rect>",
  512.     "drawRepresentation:inRect:<rect>",
  513.     "drawSelf:<rect>inView:",
  514.     "drawTitle:inRect:<rect>ofColumn:",
  515.     "drawWellInside:<rect>",
  516.     "edit:<rect>inView:editor:delegate:event:",
  517.     "highlight:<rect>inView:lit:",
  518.     "image:toRect:<rect>width:height:bps:spp:",
  519.     "image:toRect:<rect>width:height:bps:spp:config:interp:",
  520.     "imageDidNotDraw:inRect:<rect>",
  521.     "imageSize:width:height:bps:spp:config:interp:inRect:<rect>",
  522.     "imageSize:width:height:bps:spp:inRect:<rect>",
  523.     "initContent:<rect>style:backing:buttonMask:defer:",
  524.     "initContent:<rect>style:backing:buttonMask:defer:screen:",
  525.     "initData:fromRect:<rect>",
  526.     "initFrame:<rect>",
  527.     "initFrame:<rect>icon:tag:target:action:key:enabled:",
  528.     "initFrame:<rect>mode:cellClass:numRows:numCols:",
  529.     "initFrame:<rect>mode:prototype:numRows:numCols:",
  530.     "initFrame:<rect>text:alignment:",
  531.     "initFrame:<rect>title:tag:target:action:key:enabled:",
  532.     "initFromImage:rect:<rect>",
  533.     "initFromWindow:rect:<rect>",
  534.     "placeWindow:<rect>",
  535.     "placeWindow:<rect>screen:",
  536.     "placeWindowAndDisplay:<rect>",
  537.     "readImage:inRect:<rect>",
  538.     "readImage:withAlpha:inRect:<rect>",
  539.     "removeCursorRect:<rect>cursor:",
  540.     "removeCursorRect:<rect>cursor:forView:",
  541.     "renewFont:size:style:text:frame:<rect>tag:",
  542.     "renewFont:text:frame:<rect>tag:",
  543.     "renewRuns:text:frame:<rect>tag:",
  544.     "resetCursorRect:<rect>inView:",
  545.     "scrollRectToVisible:<rect>",
  546.     "select:<rect>inView:editor:delegate:start:length:",
  547.     "setFrame:<rect>",
  548.     "setFrameFromContentFrame:<rect>",
  549.     "setPaperRect:<rect>andAdjust:",
  550.     "setTrackingRect:<rect>inside:owner:tag:left:right:",
  551.     "writePSCodeInside:<rect>to:"
  552.     }
  553.     
  554. /*********** RectConversion: intermediate cleanup *************/
  555.  
  556. replace "*NULL" with "NSZeroRect"
  557.  
  558. replace "*nil" with "NSZeroRect"
  559.  
  560. /*********** RectConversion: Convert point return type only *************/
  561.  
  562. replacemethod "<sel>" with same {
  563.     replace "<rettype>" with "(NSPoint)"
  564.     }
  565.     where "<sel>" isOneOf {   
  566.     "draggedImageLocation",
  567.     "draggingLocation"
  568.     }
  569.  
  570. /*********** RectConversion: Convert one point param *************/
  571.  
  572. replacemethod "<sel>" with same {
  573.     replace "<point_type>" with "(NSPoint)"
  574.     replace "<point_arg>" with "*<point_arg>"
  575.     }
  576.     within ("<implementation>") {
  577.     replace "<point_param>->" with "*<point_param>."
  578.     replace "<point_param>" with "&<point_param>"
  579.     }
  580.     where "<sel>" isOneOf {
  581.     "acceptColor:atPoint:<point>",
  582.     "composite:toPoint:<point>",
  583.     "dissolve:toPoint:<point>",
  584.     "draggedImage:beganAt:<point>",
  585.     "draggedImage:endedAt:<point>deposited:",
  586.     "drawAt:<point>",
  587.     "getRow:andCol:forPoint:<point>",
  588.     "hitTest:<point>",
  589.     "openFile:fromImage:at:<point>inView:",
  590.     "rawScroll:<point>",
  591.     "scrollClip:to:<point>",
  592.     "scrollPoint:<point>",
  593.     "setHotSpot:<point>",
  594.     "setLocation:<point>ofCell:",
  595.     "slideDraggedImageTo:<point>",
  596.     "startTrackingAt:<point>inView:",
  597.     "testPart:<point>"
  598.     }
  599.  
  600. /*********** RectConversion: Convert one point param and one rect param *************/
  601.  
  602. replacemethod "<sel>" with same {
  603.     replace "<point_type>" with "(NSPoint)"
  604.     replace "<point_arg>" with "*<point_arg>"
  605.     replace "<rect_type>" with "(NSRect)"
  606.     replace "<rect_arg>" with "*<rect_arg>"
  607.     }
  608.     within ("<implementation>") {
  609.     replace "<rect_param>->" with "*<rect_param>."
  610.     replace "<rect_param>" with "&<rect_param>"
  611.     replace "<point_param>->" with "*<point_param>."
  612.     replace "<point_param>" with "&<point_param>"
  613.     }
  614.     where "<sel>" isOneOf {
  615.     "beginPageSetupRect:<rect>placement:<point>",
  616.     "composite:fromRect:<rect>toPoint:<point>",
  617.     "dissolve:fromRect:<rect>toPoint:<point>",
  618.     "mouse:<point>inRect:<rect2>"
  619.     }
  620.  
  621. /*********** RectConversion: Return one point param; used to return id *************/
  622.  
  623. replacemethod "<old>" with "<new>" {
  624.     replace "<rettype>" with "(NSPoint)"
  625.     replace "<point_type>" with "(NSPoint)"
  626.     replace "<point_arg>" with "*<point_arg>"
  627.     replace "<call>" with "*<point_arg> = <call>"
  628.     }
  629.     within ("<implementation>") {
  630.     replace "<point_param>->" with "*<point_param>."
  631.     replace "<point_param>" with "&<point_param>"
  632.     replace "return self;" with "return <point_param>;" 
  633.     replace "return (self);" with "return (<point_param>);"
  634.     }
  635.     where ("<old>", "<new>" ) isOneOf {
  636.     ("constrainScroll:<point>", "constrainScroll:<point>"),
  637.     ("getLocation:<point>forSubmenu:<2>", "locationForSubmenu:<2>"),
  638.     ("getLocation:<point>ofCell:<2>", "locationOfCell:<2>"),
  639.     ("getLocation:<point>ofView:<2>", "locationOfView:<2>"),
  640.     ("getMouseLocation:<point>", "mouseLocation")
  641.     ("convertBaseToScreen:<point>", "convertBaseToScreen:<point>"),
  642.     ("convertPoint:<point>fromView:", "convertPoint:<point>fromView:"),
  643.     ("convertPoint:<point>toView:", "convertPoint:<point>toView:"),
  644.     ("convertPointToSuperview:<point>", "convertPointToSuperview:<point>"),
  645.     ("convertPointFromSuperview:<point>", "convertPointFromSuperview:<point>"),
  646.     ("convertScreenToBase:<point>", "convertScreenToBase:<point>")
  647.     }
  648.  
  649. replacemethod "placePrintRect:<rect> offset:<point>" with "locationOfPrintRect:<rect>" {
  650.     replace "<rettype>" with "(NSPoint)"
  651.     replace "<rect_type>" with "(NSRect)"
  652.     replace "<rect_arg>" with "*<rect_arg>"
  653.     replace "<call>" with "*<point_arg> = <call>"
  654.     replace "<implementation>" with "
  655.     NSPoint <point_param>;
  656.     <implementation>"
  657.     }
  658.     within ("<implementation>") {
  659.     replace "<rect_param>->" with "*<rect_param>."
  660.     replace "<rect_param>" with "&<rect_param>"
  661.     replace "<point_param>->" with "*<point_param>."
  662.     replace "<point_param>" with "&<point_param>"
  663.     replace "return self;" with "return <point_param>;" 
  664.     replace "return (self);" with "return (<point_param>);"
  665.     }
  666.  
  667. /*********** RectConversion: Convert two point params *************/
  668.  
  669. replacemethod "<sel>" with same {
  670.     replace "<point1_type>" with "(NSPoint)"
  671.     replace "<point1_arg>" with "*<point1_arg>"
  672.     replace "<point2_type>" with "(NSPoint)"
  673.     replace "<point2_arg>" with "*<point2_arg>"
  674.     }
  675.     within ("<implementation>") {
  676.     replace "<point1_param>->" with "*<point1_param>."
  677.     replace "<point1_param>" with "&<point1_param>"
  678.     replace "<point2_param>->" with "*<point2_param>."
  679.     replace "<point2_param>" with "&<point2_param>"
  680.     }
  681.     where "<sel>" isOneOf {
  682.     "continueTracking:<point1>at:<point2>inView:",
  683.     "slideImage:from:<point1>to:<point2>",
  684.     "stopTracking:<point1>at:<point2>inView:mouseIsUp:"
  685.     }
  686.  
  687. /*********** RectConversion: Convert one point param, convert second point param to NSSize *************/
  688.  
  689. replace "[<obj> dragImage:<image> at:<loc> offset:<NULL> event:<event> pasteboard:<pboard> source:<source> slideBack:<flag>]" with "[<obj> CONVERSIONdragImage:<image> at:<loc> offset:NSZeroSize event:<event> pasteboard:<pboard> source:<source> slideBack:<flag>]"
  690.     where "<NULL>" isOneOf {
  691.     "NULL",
  692.     "0",
  693.     "nil"
  694.     }
  695.  
  696. replace "[<obj> scrollRect:<rect> by:<NULL>]" with "[<obj> CONVERSIONscrollRect:<rect> by:NSZeroSize]"
  697.     where "<NULL>" isOneOf {
  698.     "NULL",
  699.     "0",
  700.     "nil"
  701.     }
  702.  
  703. replacemethod "dragImage:at:<point1>offset:<point2>event:pasteboard:source:slideBack:" with same {
  704.     replace "<point1_type>" with "(NSPoint)"
  705.     replace "<point1_arg>" with "*<point1_arg>"
  706.     replace "<point2_type>" with "(NSSize)"
  707.     replace "<point2_arg>" with "NSMakeSize((<point2_arg>)->x,(<point2_arg>)->y)"
  708.     }
  709.     within ("<implementation>") {
  710.     replace "<point1_param>->" with "*<point1_param>."
  711.     replace "<point1_param>" with "&<point1_param>"
  712.     replace "<point2_param>->" with "*<point2_param>."
  713.     replace "<point2_param>" with "&<point2_param>"
  714.     replace "<point2_param>.x" with "&<point2_param>.width"
  715.     replace "<point2_param>.y" with "&<point2_param>.height"
  716.     }
  717.  
  718. replacemethod "scrollRect:<rect>by:<point>" with same {
  719.     replace "<rect_type>" with "(NSPoint)"
  720.     replace "<rect_arg>" with "*<rect_arg>"
  721.     replace "<point_type>" with "(NSSize)"
  722.     replace "<point_arg>" with "NSMakeSize((<point_arg>)->x,(<point_arg>)->y})"
  723.     }
  724.     within ("<implementation>") {
  725.     replace "<rect_param>->" with "*<rect_param>."
  726.     replace "<rect_param>" with "&<rect_param>"
  727.     replace "<point_param>->" with "*<point_param>."
  728.     replace "<point_param>" with "&<point_param>"
  729.     replace "<point_param>.x" with "&<point_param>.width"
  730.     replace "<point_param>.y" with "&<point_param>.height"
  731.     }
  732.  
  733. replace "CONVERSIONdragImage" with "dragImage"   
  734.  
  735. replace "CONVERSIONscrollRect" with "scrollRect"    
  736.  
  737. /*********** RectConversion: intermediate cleanup *************/
  738.  
  739. replace "*NULL" with "NSZeroPoint"
  740.  
  741. replace "*nil" with "NSZeroPoint"
  742.  
  743. /*********** RectConversion: Convert one of two size params, return the other used to return id *************/
  744.  
  745. replacemethod "<old>" with "<new>" {
  746.     replace "<rettype>" with "(NSSize)"
  747.     replace "<size2_type>" with "(NSSize)"
  748.     replace "<size2_arg>" with "*<size2_arg>"
  749.     replace "<call>" with "*<size1_arg> = <call>"
  750.     replace "<implementation>" with "
  751.     NSSize <size1_param>;
  752.     <implementation>"
  753.     }
  754.     within ("<implementation>") {
  755.     replace "<size1_param>->" with "*<size1_param>."
  756.     replace "<size1_param>" with "&<size1_param>"
  757.     replace "<size2_param>->" with "*<size2_param>."
  758.     replace "<size2_param>" with "&<size2_param>"
  759.     replace "return self" with "return <size1_param>"
  760.     replace "return (self)" with "return (<size1_param>)"
  761.     }
  762.     where ("<old>", "<new>") isOneOf {
  763. /*+*/    ("getContentSize:<size1>forFrameSize:<size2>horizScroller:<3>vertScroller:<4>borderType:<5>", "contentSizeForFrameSize:<size2> hasHorizontalScroller:<3>hasVerticalScroller:<4>borderType:<5>"),
  764. /*+*/    ("getFrameSize:<size1>forContentSize:<size2>horizScroller:<3>vertScroller:<4>borderType:<5>", "frameSizeForContentSize:<size2>hasHorizontalScroller:<3>hasVerticalScroller:<4>borderType:<5>")
  765.     }
  766.  
  767. /*********** RectConversion: return one size param, used to return id *************/
  768.  
  769. replacemethod "<old>" with "<new>" {
  770.     replace "<rettype>" with "(NSSize)"
  771.     replace "<size_type>" with "(NSSize)"
  772.     replace "<size_arg>" with "*<size_arg>"
  773.     replace "<call>" with "*<size_arg> = <call>"
  774.     replace "<implementation>" with "
  775.     NSSize <size_param>;
  776.     <implementation>"
  777.     }
  778.     within ("<implementation>") {
  779.     replace "<size_param>->" with "*<size_param>."
  780.     replace "<size_param>" with "&<size_param>"
  781.     replace "return self;" with "return <size_param>;" 
  782.     replace "return (self);" with "return (<size_param>);"
  783.     }
  784.     where ("<old>", "<new>" ) isOneOf {
  785.     ("getCellSize:<size>", "cellSize"),
  786.     ("getContentSize:<size>", "contentSize"),
  787.     ("getIntercell:<size>", "intercell"),
  788.     ("getMaxSize:<size>", "maxSize"),
  789.     ("getMinSize:<size>", "minSize"),
  790.     ("getOffsets:<size>", "offsets"),
  791.     ("getScreenSize:<size>", "screenSize"),
  792.     ("getSize:<size>", "size"),
  793. /*+*/    ("getSize:<size>for:<2>", "sizeFor:<2>")
  794.     ("textWillWrite:paperSize:<size>", "textWillWrite:"),
  795.     ("calcCellSize:<size>", "cellSize"),
  796.     }
  797.  
  798. replacemethod "<old>" with "<new>" {
  799.     replace "<rettype>" with "(NSSize)"
  800.     replace "<size_type>" with "(NSSize)"
  801.     replace "<size_arg>" with "*<size_arg>"
  802.     replace "<call>" with "*<size_arg> = <call>"
  803.     }
  804.     within ("<implementation>") {
  805.     replace "<size_param>->" with "*<size_param>."
  806.     replace "<size_param>" with "&<size_param>"
  807.     replace "return self;" with "return <size_param>;" 
  808.     replace "return (self);" with "return (<size_param>);"
  809.     }
  810.     where ("<old>", "<new>" ) isOneOf {
  811.     ("windowWillResize:toSize:<size>", "windowWillResize:toSize:<size>"),
  812.     ("convertSize:<size>fromView:", "convertSize:<size>fromView:"),
  813.     ("convertSize:<size>toView:", "convertSize:<size>toView:"),
  814.     }
  815.  
  816. /*********** RectConversion: convert one size param *************/
  817.  
  818. replacemethod "<sel>" with same {
  819.     replace "<size_type>" with "(NSSize)"
  820.     replace "<size_arg>" with "*<size_arg>"
  821.     }
  822.     within ("<implementation>") {
  823.     replace "<size_param>->" with "*<size_param>."
  824.     replace "<size_param>" with "&<size_param>"
  825.     }
  826.     where "<sel>" isOneOf {
  827. /*+*/    "newSize:<size>",
  828.     "titleWidth:<size>",
  829.     "initSize:<size>",
  830.     "resizeSubviews:<size>",
  831.     "setCellSize:<size>",
  832.     "setIntercell:<size>",
  833.     "setMaxSize:<size>",
  834.     "setMinSize:<size>",
  835.     "setSize:<size>",
  836.     "splitView:resizeSubviews:<size>",
  837.     "superviewSizeChanged:<size>",
  838.     "textDidRead:paperSize:<size>"
  839.     }
  840.    
  841. /*********** RectConversion: convert size return type only *************/
  842.  
  843. replacemethod "<sel>" with same {
  844.     replace "<rettype>" with "(NSSize)"
  845.     }
  846.     where "<sel>" isOneOf {   
  847.     "pageSizeForPaper:",
  848.     "sizeForKey:inTable:"
  849.     }
  850.  
  851. /*********** RectConversion: Convert rect param; return size param; used to return id *************/
  852.  
  853. replacemethod "calcCellSize:<size>inRect:<rect>" with "cellSizeForBounds:<rect>" {
  854.     replace "<rettype>" with "(NSSize)"
  855.     replace "<rect_type>" with "(NSRect)"
  856.     replace "<rect_arg>" with "*<rect_arg>"
  857.     replace "<call>" with "*<size_arg> = <call>"
  858.     replace "<implementation>" with "
  859.     NSSize <size_param>;
  860.     <implementation>"
  861.     }
  862.     within ("<implementation>") {
  863.     replace "<size_param>->" with "*<size_param>."
  864.     replace "<size_param>" with "&<size_param>"
  865.     replace "<rect_param>->" with "*<rect_param>."
  866.     replace "<rect_param>" with "&<rect_param>"
  867.     replace "return self" with "return <size_param>"
  868.     replace "return (self)" with "return (<size_param>)"
  869.     }
  870.  
  871. /*********** RectConversion: size from :: *************/
  872.  
  873. replacemethod "<old>" with "<new>" {
  874.     replace "<size_type>" with "(NSSize)"
  875.     replace "<size_param>" with "SIZEPARAM"
  876.     replace "<size_arg>" with "NSMakeSize(<x_arg>, <y_arg>)"
  877.     }
  878.     within ("<implementation>") {
  879.         replace ".<x_param>" with ".XPARAM"
  880.         replace ".<y_param>" with ".YPARAM"
  881.         replace "-><x_param>" with "->XPARAM"
  882.         replace "-><y_param>" with "->YPARAM"
  883.         replace "<x_param>" with "SIZEPARAM.width"
  884.         replace "<y_param>" with "SIZEPARAM.height"
  885.     replace ".XPARAM" with ".<x_param>"
  886.     replace ".YPARAM" with ".<y_param>"
  887.     replace "SIZEPARAM" with "<newname>"
  888.     }
  889.     within ("<call>") {
  890.     replace "SIZEPARAM" with "<newname>"
  891.     }
  892.     where ("<old>", "<new>", "<newname>") isOneOf {
  893.     ("drawPageBorder:<x> :<y>", "drawPageBorderWithSize:<size>", "_borderSize"), 
  894.     ("drawSheetBorder:<x> :<y>", "drawSheetBorderWithSize:<size>", "_borderSize"), 
  895.     ("scale:<x> :<y>", "scaleUnitSquareToSize:<size>", "_newUnitSize"), 
  896.     ("setDrawSize:<x> :<y>", "setBoundsSize:<size>", "_newSize"), 
  897.     ("setOffsets:<x> :<y>", "setContentViewMargins:<size>", "_offsetSize"), 
  898.     ("sizeTo:<x> :<y>", "setFrameSize:<size>", "_newSize"),
  899.     ("sizeWindow:<x> :<y>", "setContentSize:<size>", "_contentSize")
  900.     }
  901.  
  902. replace "drawPageBorderWithSize:(NSSize)SIZEPARAM" with "drawPageBorderWithSize:(NSSize)_borderSize"
  903.  
  904. replace "drawSheetBorderWithSize:(NSSize)SIZEPARAM" with "drawSheetBorderWithSize:(NSSize)_borderSize"
  905.  
  906. replace "scaleUnitSquareToSize:(NSSize)SIZEPARAM" with "scaleUnitSquareToSize:(NSSize)_newUnitSize"
  907.  
  908. replace "setBoundsSize:(NSSize)SIZEPARAM" with "setBoundsSize:(NSSize)_newSize"
  909.  
  910. replace "setContentViewMargins:(NSSize)SIZEPARAM" with "setContentViewMargins:(NSSize)_offsetSize"
  911.  
  912. replace "setFrameSize:(NSSize)SIZEPARAM" with "setFrameSize:(NSSize)_newSize"
  913.  
  914. replace "setContentSize:(NSSize)SIZEPARAM" with "setContentSize:(NSSize)_contentSize"
  915.  
  916. /*********** RectConversion: intermediate cleanup *************/
  917.  
  918. replace "*NULL" with "NSZeroSize"
  919.  
  920. replace "*nil" with "NSZeroSize"
  921.  
  922. /*********** RectConversion: piont from :: *************/
  923.  
  924. replacemethod "<old>" with "<new>" {
  925.     replace "<point_type>" with "(NSPoint)"
  926.     replace "<point_param>" with "POINTPARAM"
  927.     replace "<point_arg>" with "NSMakePoint(<x_arg>, <y_arg>)"
  928.     }
  929.     within ("<implementation>") {
  930.         replace ".<x_param>" with ".XPARAM"
  931.         replace ".<y_param>" with ".YPARAM"
  932.         replace "-><x_param>" with "->XPARAM"
  933.         replace "-><y_param>" with "->YPARAM"
  934.         replace "<x_param>" with "POINTPARAM.x"
  935.         replace "<y_param>" with "POINTPARAM.y"
  936.     replace ".XPARAM" with ".<x_param>"
  937.     replace ".YPARAM" with ".<y_param>"
  938.     replace "POINTPARAM" with "<newname>"
  939.     }
  940.     where ("<old>", "<new>", "<newname>") isOneOf {
  941.     ("dragFrom:<x>:<y>eventNum:<num>", "dragFromPoint:<point> eventNumber:<num>", "_aPoint"), 
  942.     ("moveTo:<x> :<y>", "setFrameOrigin:<point>", "_newOrigin"), 
  943.     ("moveTopLeftTo:<x> :<y>", "setFrameTopLeftPoint:<point>", "_newTopLeft"), 
  944.     ("setDrawOrigin:<x> :<y>", "setBoundsOrigin:<point>", "_newOrigin"), 
  945.     ("translate:<x> :<y>", "translateOriginToPoint:<point>", "_translation")
  946.     }
  947.     
  948. replace "dragFromPoint:(NSPoint)POINTPARAM" with "dragFromPoint:(NSPoint)_aPoint"
  949.  
  950. replace "setFrameOrigin:(NSPoint)POINTPARAM" with "setFrameOrigin:(NSPoint)_newOrigin"
  951.  
  952. replace "setFrameTopLeftPoint:(NSPoint)POINTPARAM" with "setFrameTopLeftPoint:(NSPoint)_newTopLeft"
  953.  
  954. replace "setBoundsOrigin:(NSPoint)POINTPARAM" with "setBoundsOrigin:(NSPoint)_newOrigin"
  955.  
  956. replace "translateOriginToPoint:(NSPoint)POINTPARAM" with "translateOriginToPoint:(NSPoint)_translation"
  957.  
  958. /*********** RectConversion: clean up *************/
  959.  
  960. replace "&*<t tok>" with "<t tok>"
  961.  
  962. replace "*&<t tok>" with "<t tok>"
  963.  
  964. /* this parses differently */
  965. replace "*&&<t tok>" with "&<t tok>"
  966.  
  967. replace "&(NXRect *)*<t tok>" with "<t tok>"
  968.  
  969. replace "*(NXRect *)&<t tok>" with "<t tok>"
  970.  
  971. replace "*(NXRect *)0" with "NSZeroRect"
  972.  
  973. replace "*(NXPoint *)0" with "NSZeroPoint"
  974.  
  975. replace "*(NXSize *)0" with "NSZeroSize"
  976.  
  977. replace "*(NXRect *)nil" with "NSZeroRect"
  978.  
  979. replace "*(NXPoint *)nil" with "NSZeroPoint"
  980.  
  981. replace "*(NXSize *)nil" with "NSZeroSize"
  982.  
  983. replace "!!<w w><t tok>" with "<w w><t tok>"
  984.  
  985. replace ":*[<b method>]" with ":[<b method>]"
  986.  
  987. replace "NSMakePoint(<point>.x, <point>.y)" with "<point>"
  988.  
  989. replace "NSMakeSize(<size>.width, <size>.height)" with "<size>"
  990.     
  991. replace ".&size" with ".size"
  992.  
  993. replace ".&rect" with ".rect"
  994.  
  995. replace ".&point" with "->point"
  996.  
  997. replace "->&size" with "->size"
  998.  
  999. replace "->&rect" with "->rect"
  1000.  
  1001. replace "->&point" with "->point"
  1002.  
  1003. replace "NXRect" with "NSRect"
  1004.  
  1005. replace "NXPoint" with "NSPoint"
  1006.  
  1007. replace "NXSize" with "NSSize"
  1008.