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