home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / ScreenConversion.tops < prev    next >
Encoding:
Text File  |  1995-03-30  |  3.4 KB  |  95 lines

  1. /*********** ScreenConversion: header files ***********/
  2.  
  3. replace "#import \"screens.h\"" with "#import \"NSScreen.h\""
  4.  
  5. replace "#import <AppKit/screens.h>" with "#import <AppKit/NSScreen.h>"
  6.  
  7. replace "#include \"screens.h\"" with "#include \"NSScreen.h\""
  8.  
  9. replace "#include <AppKit/screens.h>" with "#include <AppKit/NSScreen.h>"
  10.  
  11. /*********** ScreenConversion: Application methods ***********/
  12.  
  13. replace "[NSApp mainScreen]" with "[NSScreen mainScreen]"
  14.  
  15. replace "[NSApp colorScreen]" with "[NSScreen deepestScreen]"
  16.  
  17. replacemethod "getScreens:count:" with same
  18.     error "ScreenConversion: 'getScreens:count:' has been replaced by NSScreen 'screens' (returning an NSArray instance)"
  19.  
  20. replacemethod "mainScreen" with same
  21.     error "ScreenConversion: 'mainScreen' has been replaced by NSScreen 'mainScreen'"
  22.  
  23. replace "[NSApp screenSize]" with "[[NSScreen mainScreen] frame].size"
  24.  
  25. replacemethod "colorScreen" with same
  26.     error "ScreenConversion: 'colorScreen' has been replaced by NSScreen 'deepestScreen'"
  27.  
  28. replacemethod "screenSize" with same
  29.     error "ScreenConversion: '[NSApp screenSize]' has been replaced by NSScreen '[[NSScreen mainScreen] frame].size'"
  30.  
  31. /*********** ScreenConversion: mark NXScreens ***********/
  32.  
  33. replace "NXScreen *" with "NXScreen"
  34.  
  35. replace "const NXScreen" with "NXScreen"
  36.  
  37. replace    "- <b arg1>:(NXScreen)<token theScreen><b arg2><w w2>{<scope implementation>}" with "- <arg1>:(NSScreen *)<theScreen> <arg2><w2>{<implementation>}"
  38.     within  ("<implementation>"){
  39.         replace "<t theScreen>" "(TOPS__SCREEN)<theScreen>"
  40.     }
  41.  
  42. replace    "<t fun>(<b arg1>NXScreen <t struct><b arg2>)<w w>{<scope implementation>}" with "<fun>(<arg1>NSScreeen *<struct><arg2>)<w w>{<scope implementation>}"
  43.     within ("<implementation>"){
  44.         replace "<struct>" "(TOPS__SCREEN)<struct>"
  45.     }
  46.  
  47. replace    "NXScreen <b variables>;" with "NSScreen <variables>;"
  48.     within ("<variables>"){
  49.     replace    "<t theScreen>" with "*(TOPSTEMP__SCREEN)<theScreen>"
  50.     replace    "**" with "*"
  51.     }
  52.  
  53. replace    "(TOPSTEMP__SCREEN)<t theScreen><scope implementation>}" with same
  54.     within ("<implementation>"){
  55.         replace "<t theScreen>" "(TOPS__SCREEN)<t theScreen>"
  56.     }
  57.  
  58. replace "(NXScreen)" with "(NSScreen *)"
  59.  
  60. replace "NXScreen*" with "NSScreen **"
  61.  
  62. replace "NXScreen<w w><t tok>" with "NSScreen<w w>*<t tok>"
  63.  
  64. /*********** ScreenConversion: prepare for replacemets ***********/
  65.  
  66. replace    "&(TOPS__SCREEN)<t theScreen>" with "(TOPS__SCREEN)<theScreen>"
  67.  
  68. replace    "*(TOPS__SCREEN)<t theScreen>" with "(TOPS__SCREEN)<theScreen>"
  69.  
  70. replace    "((TOPS__SCREEN)<t theScreen>)." with "(TOPS__SCREEN)<theScreen>."
  71.  
  72. replace    "((TOPS__SCREEN)<t theScreen>)->" with    "(TOPS__SCREEN)<theScreen>."
  73.  
  74. replace    "(TOPS__SCREEN)<t theScreen>->" with "(TOPS__SCREEN)<theScreen>."
  75.  
  76. /*********** ScreenConversion: make replacemets ***********/
  77.  
  78. replace "(TOPS__SCREEN)<theScreen>.screenBounds" with "[(TOPS__SCREEN)<theScreen> frame]"
  79.  
  80. replace "(TOPS__SCREEN)<theScreen>->screenBounds" with "[(TOPS__SCREEN)<theScreen> frame]"
  81.  
  82. replace "(TOPS__SCREEN)<theScreen>.screenNumber" with same
  83.     error "ScreenConversion: screenNumber is not in the API anymore and is no longer necessary. See the NSScreen class."
  84.  
  85. replace "(TOPS__SCREEN)<theScreen>.depth" with "[screen depth]"
  86.  
  87. /*********** ScreenConversion: cleanup ***********/
  88.  
  89. replace "(TOPS__SCREEN)" with ""
  90.  
  91. replace "(TOPSTEMP__SCREEN)" with ""
  92.  
  93. replace "NXScreen" with same
  94.     error "ScreenConversion: the NXScreen structure is obsolete; use the NSScreen class"
  95.