home *** CD-ROM | disk | FTP | other *** search
Wrap
/*********** PrintingConversion: PrintInfo *************/ /* Remove andAdjust:YES clauses automatically and do some renaming */ replace "[<obj> setOrientation:<arg1> andAdjust:YES]" with "[<obj> setOrientation:<arg1>]" replace "[<obj> setPaperType:<arg1> andAdjust:YES]" with "[<obj> setPaperName:<arg1>]" replace "[<obj> setPaperRect:<arg1> andAdjust:YES]" with "[<obj> setPaperSize:(<arg1>).size]" replacemethod "paperType" with "paperName" replacemethod "paperRect" with "paperSize" error "PrintingConversion: paperRect method changed to paperSize. Resolve type conflict." replace "<w white>[<obj> setMarginLeft:<arg1> right:<arg2> top:<arg3> bottom:<arg4>];" with "[<obj> setLeftMargin:<arg1>]; <white>[<obj> setRightMargin:<arg2>]; <white>[<obj> setTopMargin:<arg3>]; <white>[<obj> setBottomMargin:<arg4>];" warning "PrintingConversion: May be able to remove some of the [<obj> setXXXXMargin:] calls" replace "<w white>[<obj> getMarginLeft:<arg1> right:<arg2> top:<arg3> bottom:<arg4>];" with "*(<arg1>) = [<obj> leftMargin]; <white>*(<arg2>) = [<obj> rightMargin]; <white>*(<arg3>) = [<obj> topMargin]; <white>*(<arg4>) = [<obj> bottomMargin];" warning "PrintingConversion: May be able to remove some of the [<obj> xxxxMargin:] calls" /* Many methods have been removed in favor of accessing them directly from the NSPrintInfo dictionary */ replace "[<obj> <oldMethod>]" with "[[[<obj> dictionary] objectForKey:<newKey>] <newValueMethod>]" where ("<oldMethod>", "<newKey>", "<newValueMethod>") isOneOf { ("scalingFactor", "NSPrintScalingFactor", "floatValue"), ("isAllPages", "NSPrintAllPages", "boolValue"), ("firstPage", "NSPrintFirstPage", "intValue"), ("lastPage", "NSPrintLastPage", "intValue"), ("copies", "NSPrintCopies", "intValue"), ("pagesPerSheet", "NSPrintPagesPerSheet", "intValue"), ("reversePageOrder", "NSPrintReversePageOrder", "boolValue"), } replace "[<obj> <oldMethod>:<arg1>]" with "[[[<obj> dictionary] setObject:[NSNumber <newValueMethod>:<arg1>] forKey:<newKey>]" where ("<oldMethod>", "<newKey>", "<newValueMethod>") isOneOf { ("setScalingFactor", "NSPrintScalingFactor", "numberWithFloat"), ("setAllPages", "NSPrintAllPages", "numberWithBool"), ("setFirstPage", "NSPrintFirstPage", "numberWithInt"), ("setLastPage", "NSPrintLastPage", "numberWithInt"), ("setCopies", "NSPrintCopies", "numberWithInt"), ("setPagesPerSheet", "NSPrintPagesPerSheet", "numberWithInt"), ("setReversePageOrder", "NSPrintReversePageOrder", "numberWithBool"), } replace "[<obj> paperFeed]" with "[[<obj> dictionary] objectForKey:NSPrintPaperFeed]" replace "[<obj> setPaperFeed:<arg1>]" with "[[<obj> dictionary] setObject:<arg1> forKey:NSPrintPaperFeed]" replace "[<obj> valueForJobFeature:<arg1>]" with "[[[<obj> dictionary] objectForKey:NSPrintJobFeatures] objectForKey:<arg1>]" replace "[<obj> removeJobFeature:<arg1>]" with "[[[<obj> dictionary] objectForKey:NSPrintJobFeatures] removeObjectForKey:<arg1>]" /* A couple of methods have been moved from PrintInfo to NSPrintOperation */ replace "[<obj> currentPage]" with "[[NSPrintOperation currentOperation] currentPage]" replace "[<obj> context]" with same warning "PrintingConversion: [[NSApp printInfo] context] is now [[NSPrintOperation currentOperation] context]" /* The current PrintInfo object now depends on context */ replace "[NSApp printInfo]" with "[NSPrintInfo sharedPrintInfo]" warning "PrintingConversion: The current PrintInfo object now depends on context. '[NSPrintInfo sharedPrintInfo]' used to be '[NSApp printInfo]'. This might want to be [[NSPrintOperation currentOperation] printInfo] or possibly [[PageLayout new] printInfo]." replace "[<obj> printInfo]" with same warning "PrintingConversion: [NSApp printInfo] is now [NSPrintInfo sharedPrintInfo]. This might want to be [[NSPrintOperation currentOperation] printInfo] or possibly [[PageLayout new] printInfo]." replace "[<obj> setPrintInfo:<arg1>]" with "[NSPrintInfo setSharedPrintInfo:<arg1>]" warning "PrintingConversion: '[NSPrintInfo setSharedPrintInfo:<arg1>]' used to be '[<obj> setPrintInfo:<arg1>]'. This might want to be [[NSPrintOperation setCurrentOperation:<arg1>] printInfo] or possibly [[PageLayout new] runModalWithPrintInfo:<arg1>]" /* FIXME -- Not sure how to do declaration conversion for the above. Really need to know which class the declaration is in. */ replacemethod "getDefaultPrinter" with "defaultPrinter" replacemethod "<method>" with same error "PrintingConversion: <method> is obsolete" where ("<method>") isOneOf { ("initializeJobDefaults"), ("outputFile"), ("pageOrder"), ("jobFeatures"), ("setOutputFile:"), ("setPageOrder:"), ("setContext:"), ("setOrientation:andAdjust:"), ("setPaperType:andAdjust:"), ("setPaperRect:andAdjust:"), ("scalingFactor"), ("isAllPages"), ("firstPage"), ("lastPage"), ("copies"), ("pagesPerSheet"), ("reversePageOrder"), ("setScalingFactor:"), ("setAllPages:"), ("setFirstPage:"), ("setLastPage:"), ("setPagesPerSheet:"), ("setCopies:"), ("setReversePageOrder:"), ("paperFeed"), ("setPaperFeed:"), ("valueForJobFeature:"), ("removeJobFeature:"), ("currentPage"), } /***** View and Window classes *****/ replacemethod "<method>" with same error "PrintingConversion: <method> is obsolete" where ("<method>") isOneOf { ("faxPSCode:"), ("faxPSCode:toList:numberList:sendAt:wantsCover:wantsNotify:wantsHires:faxName:"), ("openSpoolFile"), ("spoolFile"), ("beingPSOutput"), ("endPSOutput"), ("shouldRunPrintPanel:"), } /* FIXME -- Don't need one or the other of these */ replace "NSScreenDump" with same error "PrintingConversion: NSScreenDump is obsolete" replacemethod "print:" with same warning "PrintingConversion: printPSCode: has been renamed to print:. Rename this method?" replacemethod "<oldMethod>" with "<newMethod>" where ("<oldMethod>", "<newMethod>") isOneOf { ("writePSCodeInside:to:", "writeEPSInsideRect:toPasteboard:"), ("printPSCode:", "print:"), ("smartPrintPSCode:", "print:"), } /***** PageLayout class *****/ replacemethod "pickedLayout:" with "pickedLayoutList:" /* FIXME -- Don't need some of these... */ replace "<expr>" with same error "PrintingConversion: <expr> is obsolete" where ("<expr>") isOneOf { ("NX_PLLAYOUTBUTTON"), ("NX_PLSCALEFIELD"), } replace "NXFindPaperSize(<arg1>)" with "[NSPrintInfo sizeForPaperName:<arg1>]" /***** NXPrinter class *****/ replace "[<obj> newForName:<arg1> host:<arg2>]" with "[<obj> printerWithName:<arg1>]" error "PrintingConversion: Host argument has been removed" replace "[<obj> <oldMethod>:<arg1>]" with "[<obj> <newMethod>:<arg1>]" where ("<oldMethod>", "<newMethod>") isOneOf { ("newForName", "printerWithName"), ("newForType", "printerWithType"), } replace "NX_PRINTKEYMAXLEN" with same error "PrintingConversion: Obsolete" replacemethod "printerTypes:custom:" with "printerTypes" /***** Drawing status *****/ replace "<expr1> <op> <expr2>" with "<neg>[[NSDPSContext currentContext] isDrawingToScreen]" where ("<expr1>", "<op>", "<expr2>", "<neg>") isOneOf { ("NXDrawingStatus", "==", "NX_DRAWING", ""), ("NX_DRAWING", "==", "NXDrawingStatus", ""), ("NXDrawingStatus", "!=", "NX_DRAWING", "!"), ("NX_DRAWING", "!=", "NXDrawingStatus", "!"), } replace "<expr1> == <expr2>" with "(![[NSDPSContext currentContext] isDrawingToScreen] && <neg>[[NSPrintOperation currentOperation] isEPSOperation])" where ("<expr1>", "<expr2>", "<neg>") isOneOf { ("NXDrawingStatus", "NX_COPYING", ""), ("NX_COPYING", "NXDrawingStatus", ""), ("NXDrawingStatus", "NX_PRINTING", "!"), ("NX_PRINTING", "NXDrawingStatus", "!"), } replace "<expr1> != <expr2>" with "([[NSDPSContext currentContext] isDrawingToScreen] || <neg>[[NSPrintOperation currentOperation] isEPSOperation])" where ("<expr1>", "<expr2>", "<neg>") isOneOf { ("NXDrawingStatus", "NX_COPYING", "!"), ("NX_COPYING", "NXDrawingStatus", "!"), ("NXDrawingStatus", "NX_PRINTING", ""), ("NX_PRINTING", "NXDrawingStatus", ""), } replace "NXDrawingStatus = <args>;" with same error "PrintingConversion: NXDrawingStatus is obsolete. Can probably just delete this assignment." replace "NXDrawingStatus" with same error "PrintingConversion: NXDrawingStatus is obsolete. Use the NSDPSContext methods 'isDrawingToScreen' and 'isEPSOperation'." replace "NX_COPYING" with same error "PrintingConversion: NX_COPYING is obsolete. Use the NSDPSContext methods 'isDrawingToScreen' and 'isEPSOperation'." replace "NX_DRAWING" with same error "PrintingConversion: NX_DRAWING is obsolete. Use the NSDPSContext method 'isDrawingToScreen'." replace "NX_PRINTING" with same error "PrintingConversion: NX_PRINTING is obsolete. Use the NSDPSContext method 'isEPSOperation'."