windowing/windowserver/test/tscreenconstruct/data/batch/tscreenconstruct.bat
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 REM tscreenconstruct.bat
       
     2 REM Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 REM All rights reserved.
       
     4 REM This component and the accompanying materials are made available
       
     5 REM under the terms of "Eclipse Public License v1.0"
       
     6 REM which accompanies this distribution, and is available
       
     7 REM at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 REM 
       
     9 REM Initial Contributors:
       
    10 REM Nokia Corporation - initial contribution.
       
    11 REM 
       
    12 REM Contributors:
       
    13 REM 
       
    14 REM Description:
       
    15 REM 
       
    16 @echo off
       
    17 setlocal
       
    18 
       
    19 
       
    20 set WSINI_ARM=%EPOCROOT%epoc32\data\z\system\data\wsini.ini
       
    21 set WSINI_WINSCW=z\system\data\wsini.ini
       
    22 
       
    23 if /i "%1"=="uninstall" goto :uninstall
       
    24 if /i "%1"=="install" goto :install
       
    25 
       
    26 :help
       
    27 	echo.
       
    28 	echo Description:
       
    29 	echo This script modifies epoc ini and substitutes in the correct window server ini file for the test
       
    30 	echo Usage:
       
    31 	echo tscreenconstruct.bat install/uninstall [color] [nga] [changetracking]
       
    32 	echo 
       
    33 	echo arg1: is either install or uninstall
       
    34 	echo arg2: is one of "color4k" "color64k" "color16m" "screenconstruct" "scrmodes"
       
    35 	echo arg3: optional indicator for configuration, either nonnga, which is default or nga
       
    36 	echo arg4: optional argument to use changetracking mode in wserv, the default mode is non changetracking  
       
    37 	echo.
       
    38 	goto :done
       
    39 
       
    40 rem *** START STANDARD FILE-REPLACEMENT FUNCTIONS ***
       
    41 :replace
       
    42 	set DST=%1
       
    43 	set SRC=%2
       
    44 	echo INFO: Replacing %DST% with %SRC%
       
    45 	copy /y %DST% %DST%.original >NUL
       
    46 	if defined SRC copy /y %SRC% %DST% >NUL
       
    47 	goto :EOF
       
    48 :restore
       
    49 	echo INFO: Restoring %1 
       
    50 	if not exist %1.original echo ERROR: %1.original does not exist
       
    51 	copy /y %1.original %1 >NUL
       
    52 	del %1.original >NUL
       
    53 	goto :EOF
       
    54 :replace_em
       
    55 	if defined EMULATOR_DATA_DIR (
       
    56 		call :replace %EMULATOR_DATA_DIR%\%1 %2
       
    57 	) else (
       
    58 		call :replace %EPOCROOT%epoc32\release\winscw\udeb\%1 %2
       
    59 		call :replace %EPOCROOT%epoc32\release\winscw\urel\%1 %2
       
    60 	)
       
    61 	goto :EOF
       
    62 :replace_em2
       
    63 	if defined EMULATOR_DATA_DIR (
       
    64 		call :replace %EMULATOR_DATA_DIR%\%1 %EMULATOR_DATA_DIR%\%2
       
    65 	) else (
       
    66 		call :replace %EPOCROOT%epoc32\release\winscw\udeb\%1 %EPOCROOT%epoc32\release\winscw\udeb\%2
       
    67 		call :replace %EPOCROOT%epoc32\release\winscw\urel\%1 %EPOCROOT%epoc32\release\winscw\urel\%2
       
    68 	)
       
    69 	goto :EOF
       
    70 :restore_em
       
    71 	if defined EMULATOR_DATA_DIR (
       
    72 		call :restore %EMULATOR_DATA_DIR%\%1
       
    73 	) else (
       
    74 		call :restore %EPOCROOT%epoc32\release\winscw\udeb\%1
       
    75 		call :restore %EPOCROOT%epoc32\release\winscw\urel\%1
       
    76 	)
       
    77 	goto :EOF
       
    78 rem *** END STANDARD FILE-REPLACEMENT FUNCTIONS ***
       
    79 
       
    80 
       
    81 :install
       
    82 	set OPT_CT=
       
    83 	if /i "%3"=="changetracking"		set OPT_CT=_changetracking
       
    84 	if /i "%4"=="changetracking"		set OPT_CT=_changetracking
       
    85 	set OPT_NGA=
       
    86 	if /i "%3"=="nga" set OPT_NGA=1
       
    87 
       
    88 	set WSINI_TEST=wsini%OPT_CT%.ini
       
    89 	if /i "%2"=="screenconstruct"	set WSINI_TEST=wsini_screenconstruct%OPT_CT%.ini
       
    90 	if /i "%2"=="scrmodes"			set WSINI_TEST=wsini_scrmodes%OPT_CT%.ini
       
    91 	set WSINI_TEST=%EPOCROOT%epoc32\data\z\wstest\screenconstruct\%WSINI_TEST%
       
    92 
       
    93 	set EPOC_COLORDEPTH=color16m
       
    94 	if /i "%2"=="color4k" set EPOC_COLORDEPTH=color4k
       
    95 	if /i "%2"=="color64k" set EPOC_COLORDEPTH=color64k
       
    96 	if /i "%2"=="color16m" set EPOC_COLORDEPTH=color16m
       
    97 
       
    98 	echo Replacing files with test versions.
       
    99 	call :replace     %EPOC_INI%
       
   100 	if defined OPT_NGA (
       
   101 		echo SYMBIAN_GRAPHICS_USE_GCE on >> %EPOC_INI%
       
   102 		echo SYMBIAN_BASE_USE_GCE on >> %EPOC_INI%
       
   103 	)
       
   104 	echo COLORDEPTH %EPOC_COLORDEPTH% >> %EPOC_INI%
       
   105 	echo _NewScreen_ >> %EPOC_INI%
       
   106 	echo ScreenHeight 640 >> %EPOC_INI%
       
   107 	echo ScreenWidth  320 >> %EPOC_INI%
       
   108 
       
   109 	call :replace     %WSINI_ARM%      %WSINI_TEST%
       
   110 	call :replace_em  %WSINI_WINSCW%   %WSINI_TEST%
       
   111 	goto :done
       
   112 
       
   113 :uninstall
       
   114 	echo Restoring files
       
   115 	call :restore     %EPOC_INI%
       
   116 	call :restore     %WSINI_ARM%
       
   117 	call :restore_em  %WSINI_WINSCW%
       
   118 
       
   119 :done
       
   120 endlocal