home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2J (Developer)
/
os42jdev.iso
/
NextDeveloper
/
OpenStepConversion
/
ConversionScripts
/
IconConversion.tops
< prev
next >
Wrap
Text File
|
1996-01-22
|
5KB
|
153 lines
/*********** IconConversion: Header files ***********/
replace "#import <file>" with "/* #import <file> */"
where "<file>" isOneOf {
"\"tiff.h\""
"\"<AppKit/tiff.h>\""
}
/*********** IconConversion: named images - parameters ***********/
replacemethod /*+*/ "findImageNamed:" with "imageNamed:"
replace "[<token obj> setIcon:<name> position:<pos>]" with "[<obj> setImage:[NSImage imageNamed:<name>]], [<obj> setImagePosition:<pos>]"
replacemethod "<old>" with "<new>" {
replace "<image_type>" with "(NSImage *)"
replace "<image_arg>" with "[NSImage imageNamed:<image_arg>]"
}
within ("<implementation>") {
replace "<image_param>" with "[<image_param> name]"
}
where ("<old>", "<new>") isOneOf {
("setIcon:<image> at::", "setImage:<image> atRow:column:"),
("initIconCell:<image>", "initImageCell:<image>"),
("setIcon:<image>", "setImage:<image>"),
("setAltIcon:<image>", "setAltImage:<image>"),
("setMiniwindowIcon:<image>", "setMiniwindowImage:<image>"),
("initFrame:icon:<image> tag:target:action:key:enabled:", "initFrame:image:<image> tag:target:action:key:enabled:")
}
/*********** IconConversion: named images - return types ***********/
replacemethod "<old>" with "<new>" {
replace "<rettype>" with "(NSImage *)"
replace "<call>" with "[<call> name]"
}
within ("<implementation>") {
replace "return <retval>;" with "return [NSImage imageNamed:<retval>];"
}
where ("<old>", "<new>") isOneOf {
("icon", "image"),
("altIcon", "altImage"),
("miniwindowIcon", "miniwindowImage")
}
/*********** IconConversion: simple renaming ***********/
replacemethod "<old>" with "<new>"
where ("<old>", "<new>") isOneOf {
("getIconForFile", "iconForFile"),
("iconPosition", "imagePosition"),
("branchIcon", "branchImage"),
("branchIconH", "highlightedBranchImage"),
("setIconPosition:", "setImagePosition:"),
("iconPosition", "imagePosition"),
("iconRectForBounds:", "imageRectForBounds:")
}
/*********** IconConversion: reading, writing ***********/
replace "<t function>(<b args>)" with same
error "IconConversion: NXReadTIFF() and NXWriteTIFF() are obsolete; use NSBitmapImageRep methods instead"
where "<t function>" isOneOf {
"NXReadTIFF",
"NXWriteTIFF"
}
/*********** IconConversion: obsolete methods, functions, ... ***********/
replacemethod "setIcon:position:" with same
error "IconConversion: 'setIcon:position' is obsolete; use 'setImage:' and 'setImagePosition:'"
replace "NXGetTIFFInfo(<b args>)" with same
error "IconConversion: NXGetTIFFInfo() is obsolete; use NSBitmapImageRep methods instead."
replace "<token a>" with same
error "IconConversion: <tok> is obsolete. Use NSBitmapImageRep instead."
where "<a>" isOneOf {
"NX_PAGEHEIGHT",
"NX_BIGENDIAN",
"NX_LITTLEENDIAN",
"NX_BAD_TIFF_FORMAT",
"NX_IMAGE_NOT_FOUND",
"NX_ALLOC_ERROR",
"NX_FORMAT_NOT_YET_SUPPORTED",
"NX_FILE_IO_ERROR",
"NX_COMPRESSION_NOT_YET_SUPPORTED",
"NX_TIFF_CANT_APPEND"
}
/*********** IconConversion: image names ***********/
replace "<old>" with "<new>"
where ("<old>", "<new>") isOneOf {
("\"NXswitch\"", "\"NSSwitch\""),
("\"NXswitchH\"", "\"NSHighlightedSwitch\""),
("\"NXradio\"", "\"NSRadioButton\""),
("\"NXradioH\"", "\"NSHighlightedRadioButton\""),
("\"NXreturnSign\"", "\"NSReturnSign\""),
("\"NXmenuArrow\"", "\"NSMenuArrow\""),
("\"NXmenuArrowH\"", "\"NSHighlightedMenuArrow\""),
("\"NXscrollDown\"", "\"NSScrollDownButton\""),
("\"NXscrollDownH\"", "\"NSHighlightedScrollDownButton\""),
("\"NXscrollLeft\"", "\"NSScrollLeftButton\""),
("\"NXscrollLeftH\"", "\"NSHighlightedScrollLeftButton\""),
("\"NXscrollRight\"", "\"NSScrollRightButton\""),
("\"NXscrollRightH\"", "\"NSHighlightedScrollRightButton\""),
("\"NXscrollUp\"", "\"NSScrollUpButton\""),
("\"NXscrollUpH\"", "\"NSHighlightedScrollUpButton\""),
("\"NXLinkButton\"", "\"NSLinkButton\""),
("\"NXLinkButtonH\"", "\"NSHighlightedLinkButton\""),
("\"NXarrow\"", "\"NSArrowCursor\""),
("\"NXibeam\"", "\"NSIBeamCursor\""),
}
replace "[NSImage imageNamed:@\"app\"]" with "[NSImage imageNamed:@\"NSApplicationIcon\"]"
replace "[NSImage imageNamed:@\"NXAppTile\"]" with same
error "IconConversion: The image - NXAppTile - is no longer available in the API. Try using [NSApp setApplicationIconImage:]."
replace "[NSImage imageNamed:@<name>]" with same
error "IconConversion: The image - <name> - is no longer available in the API."
where "<name>" isOneOf {
"\"NXsquare16\"",
"\"NXsquare16H\"",
"\"NXscrollMenuDown\"",
"\"NXscrollMenuDownD\"",
"\"NXscrollMenuDownH\"",
"\"NXscrollMenuLeft\"",
"\"NXscrollMenuLeftD\"",
"\"NXscrollMenuLeftH\"",
"\"NXscrollMenuLeft\"",
"\"NXscrollMenuLeftD\"",
"\"NXscrollMenuLeftH\"",
"\"NXscrollMenuRight\"",
"\"NXscrollMenuRightD\"",
"\"NXscrollMenuRightH\"",
"\"NXscrollMenuUp\"",
"\"NXscrollMenuUpD\"",
"\"NXscrollMenuUpH\"",
"\"NXdefaultappicon\"",
"\"NXdefaulticon\""
}
replace "@\"app\"" with same
warning "IconConversion: The image named @\"app\" has been renamed @\"NSApplicationIcon\"."
/*********** IconConversion: clean up ***********/
replace "[NSImage imageNamed:[<anImage> name]]" with "<anImage>"
replace "[[NSImage imageNamed:<name>] name]" with "<name>"