home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-08-30 | 37.6 KB | 1,008 lines
/*********** RectConversion: Functions *************/ replace "NXEmptyRect(<b arg1>)" with "NSIsEmptyRect(*<b arg1>)" replace "NXDivideRect(<b arg1> , <b arg2> , <b rest>)" with "NSDivideRect(*<b arg1> , <b arg2> , <b arg1> , <b rest>)" replace "NXUnionRect(<b arg1> , <b arg2>)" with "*<b arg2> = NSUnionRect(*<b arg1> , *<b arg2>)" replace "NXContainRect" with "NXContainsRect" replace "NXContainsRect(<b arg1> , <b arg2>)" with "NSContainsRect(*<b arg1> , *<b arg2>)" replace "NXCopyBitmapFromGState(<b arg1> , <b arg2> , <b arg3>)" with "NSCopyBitmapFromGState(<b arg1> , *<b arg2> , *<b arg3>)" replace "NXCopyBits(<b arg1> , <b arg2> , <b arg3>)" with "NSCopyBits(<b arg1> , *<b arg2> , *<b arg3>)" replace "NXDrawBitmap(<b arg1> , <b rest>)" with "NSDrawBitmap(*<b arg1> , <b rest>)" replace "NXDrawButton(<t arg1>, NULL)" with "NSDrawButton(*<t arg1>, *<t arg1>)" replace "NXDrawGrayBezel(<t arg1>, NULL)" with "NSDrawGrayBezel(*<t arg1>, *<t arg1>)" replace "NXDrawGroove(<t arg1>, NULL)" with "NSDrawGroove(*<t arg1>, *<t arg1>)" replace "NXDrawWhiteBezel(<t arg1>, NULL)" with "NSDrawWhiteBezel(*<t arg1>, *<t arg1>)" replace "NXDrawTiledRects(<t arg1>, NULL, <b rest>)" with "NSDrawTiledRects(*<t arg1>, *<t arg1>, <t rest>)" replace "<t function>(<b arg1> , NULL)" with "<t function>(*<b arg1> , *<b arg1>)" warning "RectConversion: <t function> is sending first argument as clipping rect (second argument). Make sure re-evaluation of the expression isnt harmful" where "<function>" isOneOf { "NXDrawButton", "NXDrawGrayBezel", "NXDrawGroove", "NXDrawWhiteBezel" } replace "NXDrawTiledRects(<b arg1> , NULL, <b rest>)" with "NSDrawTiledRects(*<b arg1> , *<b arg1> , <b rest>)" warning "RectConversion: NXDrawTiledRects is sending first argument as clipping rect (second argument). Make sure re-evaluation of the expression isnt harmful" replace "NXDrawButton(<b arg1> , <b arg2>)" with "NSDrawButton(*<b arg1> , *<b arg2>)" replace "NXDrawGrayBezel(<b arg1> , <b arg2>)" with "NSDrawGrayBezel(*<b arg1> , *<b arg2>)" replace "NXDrawGroove(<b arg1> , <b arg2>)" with "NSDrawGroove(*<b arg1> , *<b arg2>)" replace "NXDrawWhiteBezel(<b arg1> , <b arg2>)" with "NSDrawWhiteBezel(*<b arg1> , *<b arg2>)" replace "NXDrawTiledRects(<b arg1> , <b arg2> , <b rest>)" with "*<b arg1> = NSDrawTiledRects(*<b arg1> , *<b arg2> , <b rest>)" replace "NXEqualRect(<b arg1> , <b arg2>)" with "NSEqualRects(*<b arg1> , *<b arg2>)" replace "NXEraseRect(<b arg1>)" with "NSEraseRect(*<b arg1>)" replace "NXFrameLinkRect(<b arg1> , <b arg2>)" with "NSFrameLinkRect(*<b arg1> , <b arg2>)" replace "NXFrameRect(<b arg1>)" with "NSFrameRect(*<b arg1>)" replace "NXFrameRectWithWidth(<b arg1> , <b arg2>)" with "NSFrameRectWithWidth(*<b arg1> , <b arg2>)" replace "NXHighlightRect(<b arg1>)" with "NSHighlightRect(*<b arg1>)" replace "NXInsetRect(<b arg1> , <b arg2> , <b arg3>)" with "*<b arg1> = NSInsetRect(*<b arg1> , <b arg2> , <b arg3>)" replace "NXIntegralRect(<b arg1>)" with "*<b arg1> = NSIntegralRect(*<b arg1>)" replace "(<b start><w w>NXIntersectionRect(<b arg1> , <b arg2>)" with "(<b start><w w>!NSIsEmptyRect(*<b arg2> = NSIntersectionRect(*<b arg1> , *<b arg2>))" replace "NXIntersectionRect(<b arg1> , <b arg2>)" with "*<b arg2> = NSIntersectionRect(*<b arg1> , *<b arg2>)" replace "NXIntersectsRect(<b arg1> , <b arg2>)" with "!NSIsEmptyRect(NSIntersectionRect(*<b arg1> , *<b arg2>))" replace "NXMouseInRect(<b arg1> , <b arg2> , <b arg3>)" with "NSMouseInRect(*<b arg1> , *<b arg2> , <b arg3>)" replace "NXOffsetRect(<b arg1> , <b arg2> , <b arg3>)" with "*<b arg1> = NSOffsetRect(*<b arg1> , <b arg2> , <b arg3>)" replace "NXPointInRect(<b arg1> , <b arg2>)" with "NSPointInRect(*<b arg1> , *<b arg2>)" replace "NXReadPixel(<b arg1>)" with "NSReadPixel(*<b arg1>)" replace "NXRectClip(<b arg1>)" with "NSRectClip(*<b arg1>)" replace "NXRectClipList(<b arg1> , <b arg2>)" with "NSRectClipList(<b arg1> , <b arg2>)" replace "NXRectFill(<b arg1>)" with "NSRectFill(*<b arg1>)" replace "NXRectFillList(<b args>)" with "NSRectFillList(<b args>)" replace "NXRectFillListWithGrays(<b args>)" with "NSRectFillListWithGrays(<b args>)" replace "NXSetRect(<b arg1> , <b arg2> , <b arg3> , <b arg4> , <b arg5>)" with "*<b arg1> = NSMakeRect(<b arg2>, <b arg3>, <b arg4>, <b arg5>)" replace "NXFindPaperSize(<b arg1>)" with "NXFindPaperSize(<b arg1>)" warning "RectConversion: NXFindPaperSize (will become [NSPrintInfo sizeForPaperName:<arg1>]) now returns (NSSize) instead of (NXSize *)" replace "NXLinkFrameThickness(<b arg1>)" with "NSLinkFrameThickness(<b arg1>)" /*********** RectConversion: Macros *************/ replace "NX_XMIN" with "NSMinXEdge" replace "NX_YMIN" with "NSMinYEdge" replace "NX_XMAX" with "NSMaxXEdge" replace "NX_YMAX" with "NSMaxYEdge" replace "NX_MAXX(<arg>)" with "NSMaxX(*<arg>)" replace "NX_MAXY(<arg>)" with "NSMaxY(*<arg>)" replace "NX_MIDX(<arg>)" with "NSMidX(*<arg>)" replace "NX_MIDY(<arg>)" with "NSMidY(*<arg>)" replace "NXCoord" with "float" /* first 4 rules are for token args, second 4 are for arbitrary expressions */ replace "NX_X(<t arg>) <t op> <expr>" with "<arg>->origin.x <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_Y(<t arg>) <t op> <expr>" with "<arg>->origin.y <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_WIDTH(<t arg>) <t op> <expr>" with "<arg>->size.width <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_HEIGHT(<t arg>) <t op> <expr>" with "<arg>->size.height <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_X(<arg>) <t op> <expr>" with "(<arg>)->origin.x <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_Y(<arg>) <t op> <expr>" with "(<arg>)->origin.y <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_WIDTH(<arg>) <t op> <expr>" with "(<arg>)->size.width <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_HEIGHT(<arg>) <t op> <expr>" with "(<arg>)->size.height <op> <expr>" where "<op>" isOneOf { "=", "/=", "*=", "-=", "+=", "%=", "|=", "^=", "&=", "<<=", ">>=" } replace "NX_X(<arg>)" with "NSMinX(*<arg>)" replace "NX_Y(<arg>)" with "NSMinY(*<arg>)" replace "NX_WIDTH(<arg>)" with "NSWidth(*<arg>)" replace "NX_HEIGHT(<arg>)" with "NSHeight(*<arg>)" /*********** RectConversion: 'calcUpdateRects::::' exception *************/ replacemethod "calcUpdateRects::::" with same error "RectConversion: calcUpdateRects is obsolete. The display mechanism always just operates on one rect, instead of the previous list of three." /*********** RectConversion: 'trackMouse:inRect:ofView:' exception *************/ replace "[<obj> trackMouse:<event> inRect:<NULL> ofView:<view>]" with "[<obj> trackMouse:<event> inRect:??? ofView:<view> untilMouseUp:YES]" error "RectConversion: 'trackMouse:inRect:ofView:untilMouseUp:' (used to be 'trackMouse:inRect:ofViewinRect:') should receive cells bounds for 'inRect:'" where "<NULL>" isOneOf { "NULL", "nil", "(NXRect *)0" } replacemethod "trackMouse:inRect:<rect> ofView:" with "trackMouse:inRect:<rect> ofView:untilMouseUp:<mouseup>" { replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" replace "<mouseup_type>" with "(BOOL)" replace "<mouseup_param>" with "_untilMouseUp" } warning "RectConversion: 'trackMouse:inRect:ofView:untilMouseUp:' used to be 'trackMouse:inRect:ofView:'. untilMouseUp == YES when inRect used to be NULL" within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "!&<rect_param>" with "untilMouseUp" replace "|| &<rect_param>" with "|| !untilMouseUp" replace "&& &<rect_param>" with "&& !untilMouseUp" replace "if (&<rect_param>" with "if (!untilMouseUp" replace "while (&<rect_param>" with "while (!untilMouseUp" replace "for (<b init>; &<rect_param>" with "for (<b init>; !untilMouseUp" } /*********** RectConversion: NUUL rect exceptions *************/ replace "[<rec> titleWidth:NULL]" with "[<rec> titleWidth]" replace "[<rec> composite:<op> fromRect:NULL toPoint:<point>]" with "[<rec> composite:<op> toPoint:<point>]" replace "[<rec> copyPSCodeInside:NULL to:<stream>]" with "[<rec> copyPSCodeInside:&[<rec> bounds] to:<stream>]" replace "[<rec> dissolve:<delta> fromRect:NULL toPoint:<point>]" with "[<rec> dissolve:<delta> toPoint:<point>]" 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>]" 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>]" replace "[<rec> writePSCodeInside:NULL to:<pboard>]" with "[<rec> writePSCodeInside:&[<rec> bounds] to:<pboard>]" /*********** RectConversion: Displaying exceptions *************/ replace "[<obj> <b old>]" with "[<obj> <b new>]" where ("<old>", "<new>") isOneOf { ("drawSelf:<rects> :1", "drawRect:*<rects>"), ("display:<rects> :1", "displayRect:*<rects>"), ("display:<rects> :0", "display]"), ("display:<rects> :1 :<clip>]", "displayRect:*<rects>"), ("display:<rects> :0 :<clip>]", "displayRect:[<obj> bounds]"), ("displayFromOpaqueAncestor:<rects> :1 :<clip>", "displayRect:*<rects>"), ("displayFromOpaqueAncestor:<rects> :0 :<clip>", "displayRect:[<obj> bounds]"), ("invalidate:<rects> :1]", "invalidate:*<rects>") } /* rename for consitency */ replacemethod "drawSelf:" with "drawRect:" replacemethod "<old>" with "<new>" { replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" } warning "RectConversion: <new> (used to be <old>) no longer takes an array of rects" where ("<old>", "<new>") isOneOf { ("drawSelf:<rect>:", "drawRect:<rect>"), ("display:<rect>:", "displayRect:<rect>"), ("display:<rect>::", "displayRect:<rect>"), ("displayFromOpaqueAncestor:<rect>::<3>", "displayRect:<rect>"), ("invalidate:<rect>:", "invalidate:<rect>") } replace "CONVERSIONdisplay" with "display" /*********** RectConversion: Convert one rect parameter, change return value from id to NSRect *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" replace "<call>" with "*<rect_arg> = <call>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "return self;" with "return <rect_param>;" replace "return (self);" with "return (<rect_param>);" replace "return NULL;" with "return NSZeroRect;" replace "return (NULL);" with "return (NSZeroRect);" replace "return nil;" with "return NSZeroRect;" replace "return (nil);" with "return (NSZeroRect);" } where ("<old>", "<new>" ) isOneOf { ("getIconRect:<rect>", "iconRectForBounds:<rect>"), ("getTitleRect:<rect>", "titleRectForBounds:<rect>"), ("getDrawRect:<rect>", "drawingRectForBounds:<rect>"), ("constrainFrameRect:<rect> toScreen:", "constrainFrameRect:<rect> toScreen") } replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" replace "<call>" with "*<rect_arg> = <call>" replace "<implementation>" with " NSRect <rect_param>; <implementation>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "return self;" with "return <rect_param>;" replace "return (self);" with "return (<rect_param>);" replace "return NULL;" with "return NSZeroRect;" replace "return (NULL);" with "return (NSZeroRect);" replace "return nil;" with "return NSZeroRect;" replace "return (nil);" with "return (NSZeroRect);" } where ("<old>", "<new>" ) isOneOf { ("getParagraph:start:end:rect:<rect>", "paragraphRect:start:end:"), ("getKnobRect:<rect> flipped:<2>", "knobRectFlipped:<2>"), ("getFrame:<rect>", "frame"), ("getDocVisibleRect:<rect>", "documentVisibleRect"), ("getDocRect:<rect>", "documentRect"), ("getButtonFrame:<rect>", "buttonFrame"), ("getBounds:<rect>", "bounds"), ("getBoundingBox:<rect>", "boundingBox"), ("getCellFrame:<rect>at:<2>:<3>", "cellFrameAt:<2>:<3>"), } /*********** RectConversion: 'constrainFrameRect' excpetion *************/ replace "[<obj> constrainFrameRect:<rect> toScreen:<screen>]" with same warning "RectConversion: 'constrainFrameRect:toScreen' ; might need to check if rect was changed" /*********** RectConversion: Call exceptions for return value converted from ptr/null to BOOL *************/ 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>)" where ("<old>", "<new>") isOneOf { ("getTitleFrame:<rect> ofColumn:<2>", "titleFrameOfColumn:<2>"), ("getFrame:<rect>ofInsideOfColumn:<2>", "frameOfInsideOfColumn:<2>"), ("getFrame:<rect> ofColumn:<2>", "frameOfColumn:<2>"), ("calcRect:<rect> forPart:<2>", "rectForPart:<2>"), ("getVisibleRect:<rect>", "visibleRect") } /*********** RectConversion: Convert return type from BOOL to NSRect *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<call>" with "*<rect_arg> = <call>" replace "<implementation>" with " NSRect <rect_param>; <implementation>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "return YES;" with "return <rect_param>;" replace "return (YES);" with "return (<rect_param>);" replace "return NO;" with "return NSZeroRect;" replace "return (NO);" with "return (NSZeroRect);" } where ("<old>", "<new>") isOneOf { ("getVisibleRect:<rect>", "visibleRect"), ("getRect:<rect> forPage:<2>", "rectForPage:<2>") } /*********** RectConversion: Convert return type from NXRect * to NSRect and return first param *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<call>" with "<rect_arg> = <call>" replace "<implementation>" with " NSRect <rect_param>; <implementation>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "return <exp>;" with "return *<exp>;" } where ("<old>", "<new>") isOneOf { ("getTitleFrame:<rect> ofColumn:<2>", "titleFrameOfColumn:<2>"), ("getFrame:<rect>ofInsideOfColumn:<2>", "frameOfInsideColumn:<2>"), ("getFrame:<rect>ofColumn:<2>", "frameOfColumn:<2>"), ("calcRect:<rect>forPart:<2>", "rectForPart:<2>") } /*********** RectConversion: Convert one rect param (type only) *************/ replacemethod "getImage:rect:<rect>" with same { replace "<rect_type>" with "(NSRect *)" } replacemethod "getFrame:<rect> andScreen:" with same { replace "<rect_type>" with "(NSRect *)" } replacemethod "getWindow:andRect:<rect>" with same { replace "<rect_type>" with "(NSRect *)" } /*********** RectConversion: Convert two rect params *************/ replacemethod "resizeText:<rect1>:<rect2>" with same { replace "<rect1_type>" with "(NSRect)" replace "<rect1_arg>" with "*<rect_arg>" replace "<rect2_type>" with "(NSRect)" replace "<rect2_arg>" with "*<rect_arg>" } within ("<implementation>") { replace "<rect1_param>->" with "*<rect1_param>." replace "<rect1_param>" with "&<rect1_param>" replace "<rect2_param>->" with "*<rect2_param>." replace "<rect2_param>" with "&<rect2_param>" } /*********** RectConversion: Convert one of two rect params, return other *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<rect1_type>" with "(NSRect)" replace "<rect1_arg>" with "*<rect1_arg>" replace "<call>" with "*<rect2_arg> = <call>" replace "<implementation>" with " NSRect <rect2_param>; <implementation>" } within ("<implementation>") { replace "<rect1_param>->" with "*<rect1_param>." replace "<rect1_param>" with "&<rect1_param>" replace "<rect2_param>->" with "*<rect2_param>." replace "<rect2_param>" with "&<rect2_param>" replace "return self" with "return <rect2_param>" replace "return (self)" with "return (<rect2_param>)" } where ("<old>", "<new>") isOneOf { /*+*/ ("getContentRect:<rect2>forFrameRect:<rect1>style:<3>" "contentRectForFrameRect:<rect1>style:<3>"), /*+*/ ("getFrameRect:<rect2>forContentRect:<rect1>style:<3>", "frameRectForContentRect:<rect1> style:<3>") } replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSRect)" replace "<rect1_type>" with "(NSRect)" replace "<rect1_arg>" with "*<rect1_arg>" replace "<call>" with "*<rect2_arg> = <call>" replace "<implementation>" with " NSRect <rect2_param>; <implementation>" } within ("<implementation>") { replace "<rect1_param>->" with "*<rect1_param>." replace "<rect1_param>" with "&<rect1_param>" replace "<rect2_param>->" with "*<rect2_param>." replace "<rect2_param>" with "&<rect2_param>" replace "<rect2_param>" with same error "RectConversion: <rect2_param> is no longer passed in to this method" replace "return self" with "return <rect2_param>" replace "return (self)" with "return (<rect2_param>)" } where ("<old>", "<new>") isOneOf { ("textDidResize:oldBounds:<rect1>invalid:<rect2>", "textDidResize:oldBounds:<rect1>"), } /*********** RectConversion: Convert return type from NXRect to NSRect *************/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSRect)" } where "<sel>" isOneOf { "imageRectForPaper:" "rectForKey:inTable:" } /*********** RectConversion: Convert return type from NXRect* to NSRect *************/ replacemethod "paperRect" with "paperRect" { replace "<rettype>" with "(NSRect)" replace "<call>" with "*<call>" } within ("<implementation>"){ replace "return <exp>;" with "return *<exp>;" } /*********** RectConversion: Convert one rect param *************/ replacemethod "<sel>" with same { replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" } where "<sel>" isOneOf { /*+*/ "newContent:<rect>style:backing:buttonMask:defer:", /*+*/ "newContent:<rect>style:backing:buttonMask:defer:screen:", /*+*/ "newFrame:<rect>", /*+*/ "newFrame:<rect>icon:tag:target:action:key:enabled:", /*+*/ "newFrame:<rect>mode:cellClass:numRows:numCols:", /*+*/ "newFrame:<rect>mode:prototype:numRows:numCols:", /*+*/ "newFrame:<rect>text:alignment:", /*+*/ "newFrame:<rect>title:tag:target:action:key:enabled:", /*+*/ "newFromImage:rect:<rect>", /*+*/ "newFromWindow:rect:<rect>", /*+*/ "newRect:<rect>type:window:", /*+*/ "readImage:<rect>into:", /*+*/ "sizeImage:<rect>", /*+*/ "sizeImage:<rect>pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpace:", "addCursorRect:<rect>cursor:", "addCursorRect:<rect>cursor:forView:", "adjustScroll:<rect>", "beginPage:label:bBox:<rect>fonts:", "beginPrologueBBox:<rect>creationDate:createdBy:fonts:forWhom:pages:title:", "calcDrawInfo:<rect>", "centerScanRect:<rect>", "clearTitleInRect:<rect>ofColumn:", "clipToFrame:<rect>", "convertRect:<rect>fromView:", "convertRect:<rect>toView:", "convertRectFromSuperview:<rect>", "convertRectToSuperview:<rect>", "copyPSCodeInside:<rect>to:", "dragFile:fromRect:<rect>slideBack:event:", "drawBarInside:<rect>flipped:", "drawDivider:<rect>", "drawIn:<rect>", "drawInside:<rect>inView:", "drawKnob:<rect>", "drawRepresentation:inRect:<rect>", "drawSelf:<rect>inView:", "drawTitle:inRect:<rect>ofColumn:", "drawWellInside:<rect>", "edit:<rect>inView:editor:delegate:event:", "highlight:<rect>inView:lit:", "image:toRect:<rect>width:height:bps:spp:", "image:toRect:<rect>width:height:bps:spp:config:interp:", "imageDidNotDraw:inRect:<rect>", "imageSize:width:height:bps:spp:config:interp:inRect:<rect>", "imageSize:width:height:bps:spp:inRect:<rect>", "initContent:<rect>style:backing:buttonMask:defer:", "initContent:<rect>style:backing:buttonMask:defer:screen:", "initData:fromRect:<rect>", "initFrame:<rect>", "initFrame:<rect>icon:tag:target:action:key:enabled:", "initFrame:<rect>mode:cellClass:numRows:numCols:", "initFrame:<rect>mode:prototype:numRows:numCols:", "initFrame:<rect>text:alignment:", "initFrame:<rect>title:tag:target:action:key:enabled:", "initFromImage:rect:<rect>", "initFromWindow:rect:<rect>", "placeWindow:<rect>", "placeWindow:<rect>screen:", "placeWindowAndDisplay:<rect>", "readImage:inRect:<rect>", "readImage:withAlpha:inRect:<rect>", "removeCursorRect:<rect>cursor:", "removeCursorRect:<rect>cursor:forView:", "renewFont:size:style:text:frame:<rect>tag:", "renewFont:text:frame:<rect>tag:", "renewRuns:text:frame:<rect>tag:", "resetCursorRect:<rect>inView:", "scrollRectToVisible:<rect>", "select:<rect>inView:editor:delegate:start:length:", "setFrame:<rect>", "setFrameFromContentFrame:<rect>", "setPaperRect:<rect>andAdjust:", "setTrackingRect:<rect>inside:owner:tag:left:right:", "writePSCodeInside:<rect>to:" } /*********** RectConversion: intermediate cleanup *************/ replace "*NULL" with "NSZeroRect" replace "*nil" with "NSZeroRect" /*********** RectConversion: Convert point return type only *************/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSPoint)" } where "<sel>" isOneOf { "draggedImageLocation", "draggingLocation" } /*********** RectConversion: Convert one point param *************/ replacemethod "<sel>" with same { replace "<point_type>" with "(NSPoint)" replace "<point_arg>" with "*<point_arg>" } within ("<implementation>") { replace "<point_param>->" with "*<point_param>." replace "<point_param>" with "&<point_param>" } where "<sel>" isOneOf { "acceptColor:atPoint:<point>", "composite:toPoint:<point>", "dissolve:toPoint:<point>", "draggedImage:beganAt:<point>", "draggedImage:endedAt:<point>deposited:", "drawAt:<point>", "getRow:andCol:forPoint:<point>", "hitTest:<point>", "openFile:fromImage:at:<point>inView:", "rawScroll:<point>", "scrollClip:to:<point>", "scrollPoint:<point>", "setHotSpot:<point>", "setLocation:<point>ofCell:", "slideDraggedImageTo:<point>", "startTrackingAt:<point>inView:", "testPart:<point>" } /*********** RectConversion: Convert one point param and one rect param *************/ replacemethod "<sel>" with same { replace "<point_type>" with "(NSPoint)" replace "<point_arg>" with "*<point_arg>" replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "<point_param>->" with "*<point_param>." replace "<point_param>" with "&<point_param>" } where "<sel>" isOneOf { "beginPageSetupRect:<rect>placement:<point>", "composite:fromRect:<rect>toPoint:<point>", "dissolve:fromRect:<rect>toPoint:<point>", "mouse:<point>inRect:<rect2>" } /*********** RectConversion: Return one point param; used to return id *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSPoint)" replace "<point_type>" with "(NSPoint)" replace "<point_arg>" with "*<point_arg>" replace "<call>" with "*<point_arg> = <call>" } within ("<implementation>") { replace "<point_param>->" with "*<point_param>." replace "<point_param>" with "&<point_param>" replace "return self;" with "return <point_param>;" replace "return (self);" with "return (<point_param>);" } where ("<old>", "<new>" ) isOneOf { ("constrainScroll:<point>", "constrainScroll:<point>"), ("getLocation:<point>forSubmenu:<2>", "locationForSubmenu:<2>"), ("getLocation:<point>ofCell:<2>", "locationOfCell:<2>"), ("getLocation:<point>ofView:<2>", "locationOfView:<2>"), ("getMouseLocation:<point>", "mouseLocation") ("convertBaseToScreen:<point>", "convertBaseToScreen:<point>"), ("convertPoint:<point>fromView:", "convertPoint:<point>fromView:"), ("convertPoint:<point>toView:", "convertPoint:<point>toView:"), ("convertPointToSuperview:<point>", "convertPointToSuperview:<point>"), ("convertPointFromSuperview:<point>", "convertPointFromSuperview:<point>"), ("convertScreenToBase:<point>", "convertScreenToBase:<point>") } replacemethod "placePrintRect:<rect> offset:<point>" with "locationOfPrintRect:<rect>" { replace "<rettype>" with "(NSPoint)" replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" replace "<call>" with "*<point_arg> = <call>" replace "<implementation>" with " NSPoint <point_param>; <implementation>" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "<point_param>->" with "*<point_param>." replace "<point_param>" with "&<point_param>" replace "return self;" with "return <point_param>;" replace "return (self);" with "return (<point_param>);" } /*********** RectConversion: Convert two point params *************/ replacemethod "<sel>" with same { replace "<point1_type>" with "(NSPoint)" replace "<point1_arg>" with "*<point1_arg>" replace "<point2_type>" with "(NSPoint)" replace "<point2_arg>" with "*<point2_arg>" } within ("<implementation>") { replace "<point1_param>->" with "*<point1_param>." replace "<point1_param>" with "&<point1_param>" replace "<point2_param>->" with "*<point2_param>." replace "<point2_param>" with "&<point2_param>" } where "<sel>" isOneOf { "continueTracking:<point1>at:<point2>inView:", "slideImage:from:<point1>to:<point2>", "stopTracking:<point1>at:<point2>inView:mouseIsUp:" } /*********** RectConversion: Convert one point param, convert second point param to NSSize *************/ 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>]" where "<NULL>" isOneOf { "NULL", "0", "nil" } replace "[<obj> scrollRect:<rect> by:<NULL>]" with "[<obj> CONVERSIONscrollRect:<rect> by:NSZeroSize]" where "<NULL>" isOneOf { "NULL", "0", "nil" } replacemethod "dragImage:at:<point1>offset:<point2>event:pasteboard:source:slideBack:" with same { replace "<point1_type>" with "(NSPoint)" replace "<point1_arg>" with "*<point1_arg>" replace "<point2_type>" with "(NSSize)" replace "<point2_arg>" with "NSMakeSize((<point2_arg>)->x,(<point2_arg>)->y)" } within ("<implementation>") { replace "<point1_param>->" with "*<point1_param>." replace "<point1_param>" with "&<point1_param>" replace "<point2_param>->" with "*<point2_param>." replace "<point2_param>" with "&<point2_param>" replace "<point2_param>.x" with "&<point2_param>.width" replace "<point2_param>.y" with "&<point2_param>.height" } replacemethod "scrollRect:<rect>by:<point>" with same { replace "<rect_type>" with "(NSPoint)" replace "<rect_arg>" with "*<rect_arg>" replace "<point_type>" with "(NSSize)" replace "<point_arg>" with "NSMakeSize((<point_arg>)->x,(<point_arg>)->y})" } within ("<implementation>") { replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "<point_param>->" with "*<point_param>." replace "<point_param>" with "&<point_param>" replace "<point_param>.x" with "&<point_param>.width" replace "<point_param>.y" with "&<point_param>.height" } replace "CONVERSIONdragImage" with "dragImage" replace "CONVERSIONscrollRect" with "scrollRect" /*********** RectConversion: intermediate cleanup *************/ replace "*NULL" with "NSZeroPoint" replace "*nil" with "NSZeroPoint" /*********** RectConversion: Convert one of two size params, return the other used to return id *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSSize)" replace "<size2_type>" with "(NSSize)" replace "<size2_arg>" with "*<size2_arg>" replace "<call>" with "*<size1_arg> = <call>" replace "<implementation>" with " NSSize <size1_param>; <implementation>" } within ("<implementation>") { replace "<size1_param>->" with "*<size1_param>." replace "<size1_param>" with "&<size1_param>" replace "<size2_param>->" with "*<size2_param>." replace "<size2_param>" with "&<size2_param>" replace "return self" with "return <size1_param>" replace "return (self)" with "return (<size1_param>)" } where ("<old>", "<new>") isOneOf { /*+*/ ("getContentSize:<size1>forFrameSize:<size2>horizScroller:<3>vertScroller:<4>borderType:<5>", "contentSizeForFrameSize:<size2> hasHorizontalScroller:<3>hasVerticalScroller:<4>borderType:<5>"), /*+*/ ("getFrameSize:<size1>forContentSize:<size2>horizScroller:<3>vertScroller:<4>borderType:<5>", "frameSizeForContentSize:<size2>hasHorizontalScroller:<3>hasVerticalScroller:<4>borderType:<5>") } /*********** RectConversion: return one size param, used to return id *************/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSSize)" replace "<size_type>" with "(NSSize)" replace "<size_arg>" with "*<size_arg>" replace "<call>" with "*<size_arg> = <call>" replace "<implementation>" with " NSSize <size_param>; <implementation>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" replace "return self;" with "return <size_param>;" replace "return (self);" with "return (<size_param>);" } where ("<old>", "<new>" ) isOneOf { ("getCellSize:<size>", "cellSize"), ("getContentSize:<size>", "contentSize"), ("getIntercell:<size>", "intercell"), ("getMaxSize:<size>", "maxSize"), ("getMinSize:<size>", "minSize"), ("getOffsets:<size>", "offsets"), ("getScreenSize:<size>", "screenSize"), ("getSize:<size>", "size"), /*+*/ ("getSize:<size>for:<2>", "sizeFor:<2>") ("textWillWrite:paperSize:<size>", "textWillWrite:"), ("calcCellSize:<size>", "cellSize"), } replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSSize)" replace "<size_type>" with "(NSSize)" replace "<size_arg>" with "*<size_arg>" replace "<call>" with "*<size_arg> = <call>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" replace "return self;" with "return <size_param>;" replace "return (self);" with "return (<size_param>);" } where ("<old>", "<new>" ) isOneOf { ("windowWillResize:toSize:<size>", "windowWillResize:toSize:<size>"), ("convertSize:<size>fromView:", "convertSize:<size>fromView:"), ("convertSize:<size>toView:", "convertSize:<size>toView:"), } /*********** RectConversion: convert one size param *************/ replacemethod "<sel>" with same { replace "<size_type>" with "(NSSize)" replace "<size_arg>" with "*<size_arg>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" } where "<sel>" isOneOf { /*+*/ "newSize:<size>", "titleWidth:<size>", "initSize:<size>", "resizeSubviews:<size>", "setCellSize:<size>", "setIntercell:<size>", "setMaxSize:<size>", "setMinSize:<size>", "setSize:<size>", "splitView:resizeSubviews:<size>", "superviewSizeChanged:<size>", "textDidRead:paperSize:<size>" } /*********** RectConversion: convert size return type only *************/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSSize)" } where "<sel>" isOneOf { "pageSizeForPaper:", "sizeForKey:inTable:" } /*********** RectConversion: Convert rect param; return size param; used to return id *************/ replacemethod "calcCellSize:<size>inRect:<rect>" with "cellSizeForBounds:<rect>" { replace "<rettype>" with "(NSSize)" replace "<rect_type>" with "(NSRect)" replace "<rect_arg>" with "*<rect_arg>" replace "<call>" with "*<size_arg> = <call>" replace "<implementation>" with " NSSize <size_param>; <implementation>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" replace "<rect_param>->" with "*<rect_param>." replace "<rect_param>" with "&<rect_param>" replace "return self" with "return <size_param>" replace "return (self)" with "return (<size_param>)" } /*********** RectConversion: size from :: *************/ replacemethod "<old>" with "<new>" { replace "<size_type>" with "(NSSize)" replace "<size_param>" with "SIZEPARAM" replace "<size_arg>" with "NSMakeSize(<x_arg>, <y_arg>)" } within ("<implementation>") { replace ".<x_param>" with ".XPARAM" replace ".<y_param>" with ".YPARAM" replace "-><x_param>" with "->XPARAM" replace "-><y_param>" with "->YPARAM" replace "<x_param>" with "SIZEPARAM.width" replace "<y_param>" with "SIZEPARAM.height" replace ".XPARAM" with ".<x_param>" replace ".YPARAM" with ".<y_param>" replace "SIZEPARAM" with "<newname>" } within ("<call>") { replace "SIZEPARAM" with "<newname>" } where ("<old>", "<new>", "<newname>") isOneOf { ("drawPageBorder:<x> :<y>", "drawPageBorderWithSize:<size>", "_borderSize"), ("drawSheetBorder:<x> :<y>", "drawSheetBorderWithSize:<size>", "_borderSize"), ("scale:<x> :<y>", "scaleUnitSquareToSize:<size>", "_newUnitSize"), ("setDrawSize:<x> :<y>", "setBoundsSize:<size>", "_newSize"), ("setOffsets:<x> :<y>", "setContentViewMargins:<size>", "_offsetSize"), ("sizeTo:<x> :<y>", "setFrameSize:<size>", "_newSize"), ("sizeWindow:<x> :<y>", "setContentSize:<size>", "_contentSize") } replace "drawPageBorderWithSize:(NSSize)SIZEPARAM" with "drawPageBorderWithSize:(NSSize)_borderSize" replace "drawSheetBorderWithSize:(NSSize)SIZEPARAM" with "drawSheetBorderWithSize:(NSSize)_borderSize" replace "scaleUnitSquareToSize:(NSSize)SIZEPARAM" with "scaleUnitSquareToSize:(NSSize)_newUnitSize" replace "setBoundsSize:(NSSize)SIZEPARAM" with "setBoundsSize:(NSSize)_newSize" replace "setContentViewMargins:(NSSize)SIZEPARAM" with "setContentViewMargins:(NSSize)_offsetSize" replace "setFrameSize:(NSSize)SIZEPARAM" with "setFrameSize:(NSSize)_newSize" replace "setContentSize:(NSSize)SIZEPARAM" with "setContentSize:(NSSize)_contentSize" /*********** RectConversion: intermediate cleanup *************/ replace "*NULL" with "NSZeroSize" replace "*nil" with "NSZeroSize" /*********** RectConversion: piont from :: *************/ replacemethod "<old>" with "<new>" { replace "<point_type>" with "(NSPoint)" replace "<point_param>" with "POINTPARAM" replace "<point_arg>" with "NSMakePoint(<x_arg>, <y_arg>)" } within ("<implementation>") { replace ".<x_param>" with ".XPARAM" replace ".<y_param>" with ".YPARAM" replace "-><x_param>" with "->XPARAM" replace "-><y_param>" with "->YPARAM" replace "<x_param>" with "POINTPARAM.x" replace "<y_param>" with "POINTPARAM.y" replace ".XPARAM" with ".<x_param>" replace ".YPARAM" with ".<y_param>" replace "POINTPARAM" with "<newname>" } where ("<old>", "<new>", "<newname>") isOneOf { ("dragFrom:<x>:<y>eventNum:<num>", "dragFromPoint:<point> eventNumber:<num>", "_aPoint"), ("moveTo:<x> :<y>", "setFrameOrigin:<point>", "_newOrigin"), ("moveTopLeftTo:<x> :<y>", "setFrameTopLeftPoint:<point>", "_newTopLeft"), ("setDrawOrigin:<x> :<y>", "setBoundsOrigin:<point>", "_newOrigin"), ("translate:<x> :<y>", "translateOriginToPoint:<point>", "_translation") } replace "dragFromPoint:(NSPoint)POINTPARAM" with "dragFromPoint:(NSPoint)_aPoint" replace "setFrameOrigin:(NSPoint)POINTPARAM" with "setFrameOrigin:(NSPoint)_newOrigin" replace "setFrameTopLeftPoint:(NSPoint)POINTPARAM" with "setFrameTopLeftPoint:(NSPoint)_newTopLeft" replace "setBoundsOrigin:(NSPoint)POINTPARAM" with "setBoundsOrigin:(NSPoint)_newOrigin" replace "translateOriginToPoint:(NSPoint)POINTPARAM" with "translateOriginToPoint:(NSPoint)_translation" /*********** RectConversion: clean up *************/ replace "&*<t tok>" with "<t tok>" replace "*&<t tok>" with "<t tok>" /* this parses differently */ replace "*&&<t tok>" with "&<t tok>" replace "&(NXRect *)*<t tok>" with "<t tok>" replace "*(NXRect *)&<t tok>" with "<t tok>" replace "*(NXRect *)0" with "NSZeroRect" replace "*(NXPoint *)0" with "NSZeroPoint" replace "*(NXSize *)0" with "NSZeroSize" replace "*(NXRect *)nil" with "NSZeroRect" replace "*(NXPoint *)nil" with "NSZeroPoint" replace "*(NXSize *)nil" with "NSZeroSize" replace "!!<w w><t tok>" with "<w w><t tok>" replace ":*[<b method>]" with ":[<b method>]" replace "NSMakePoint(<point>.x, <point>.y)" with "<point>" replace "NSMakeSize(<size>.width, <size>.height)" with "<size>" replace ".&size" with ".size" replace ".&rect" with ".rect" replace ".&point" with "->point" replace "->&size" with "->size" replace "->&rect" with "->rect" replace "->&point" with "->point" replace "NXRect" with "NSRect" replace "NXPoint" with "NSPoint" replace "NXSize" with "NSSize"