os/graphics/windowing/windowserver/debuglog/DECODER.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/debuglog/DECODER.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,3064 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Decodes data into text - platform independent
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "../SERVER/w32cmd.h"
    1.22 +#include "DEBUGLOG.H"
    1.23 +
    1.24 +_LIT(LogCloseBracket,")");
    1.25 +_LIT(LogComma,", ");
    1.26 +_LIT(LogString,"%S");
    1.27 +_LIT(LogClose,"Close()");
    1.28 +_LIT(LogSpaces,"  ");
    1.29 +
    1.30 +void TDebugLogOverflow::Overflow(TDes &aDes)
    1.31 +	{
    1.32 +	if (!iError)		//Should never be re-entrant but just in case
    1.33 +		{
    1.34 +		_LIT(OverflowThreeDots,"...");
    1.35 +		const TInt LenThreeDots=3;
    1.36 +		iError=ETrue;
    1.37 +		TInt length=aDes.MaxLength();
    1.38 +		if (length>LenThreeDots)
    1.39 +			{
    1.40 +			length-=LenThreeDots;
    1.41 +			if (aDes.Length()>length)
    1.42 +				aDes.SetLength(length);
    1.43 +			}
    1.44 +		aDes.AppendFormat(OverflowThreeDots,this);
    1.45 +		}
    1.46 +	}
    1.47 +
    1.48 +class TRawEventX : public TRawEvent
    1.49 +// For bypassing protected members of TRawEvent
    1.50 +	{
    1.51 +public:
    1.52 +	inline TUint Ticks();
    1.53 +	inline TInt posx();
    1.54 +	inline TInt posy();
    1.55 +	inline TInt scanCode();
    1.56 +	};
    1.57 +
    1.58 +inline TUint TRawEventX::Ticks()
    1.59 +	{return(iTicks);}
    1.60 +inline TInt TRawEventX::posx()
    1.61 +	{return(iU.pos.x);}
    1.62 +inline TInt TRawEventX::posy()
    1.63 +	{return(iU.pos.y);}
    1.64 +inline TInt TRawEventX::scanCode()
    1.65 +	{return(iU.key.scanCode __REMOVE_WINS_CHARCODE);}
    1.66 +
    1.67 +
    1.68 +GLDEF_C TInt hHandleToValue(TUint32 handle)
    1.69 +	{
    1.70 +	return(handle&0xFFFF);
    1.71 +	}
    1.72 +
    1.73 +TDesC &TWsDecoder::CommandBuf(TInt aApp)
    1.74 +	{
    1.75 +	iText.Format(_L("[start of command buffer from app %d]"), aApp);
    1.76 +	return iText;
    1.77 +	}
    1.78 +
    1.79 +TDesC &TWsDecoder::Command(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
    1.80 +	{
    1.81 +	TPtrC details(commandDetails(aClass, aOpcode, aCmdData, aHandle));
    1.82 +	iText=KNullDesC;
    1.83 +	if (details!=KNullDesC)
    1.84 +		iText=details;
    1.85 +	return iText;
    1.86 +	}
    1.87 +
    1.88 +TDesC &TWsDecoder::NewClient(TUint aConnectionHandle)
    1.89 +	{
    1.90 +	iText.Format(_L("Client Connected %d"), aConnectionHandle);
    1.91 +	iRequestFuncClass=ENewClientClass;
    1.92 +	return iText;
    1.93 +	}
    1.94 +
    1.95 +TDesC &TWsDecoder::CommandReply(TInt aData)
    1.96 +	{
    1.97 +	iText.Format(_L("returns %d (0x%x)"), aData, aData);
    1.98 +	return iText;
    1.99 +	}
   1.100 +
   1.101 +TDesC &TWsDecoder::CommandReplyBuf(const TDesC8 &aDes)
   1.102 +	{
   1.103 +	TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, &aDes, NULL));
   1.104 +	iText=KNullDesC;
   1.105 +	if (details!=KNullDesC)
   1.106 +		{
   1.107 +		iText=LogSpaces;
   1.108 +		TDebugLogTextHandler::Append(iText, details);
   1.109 +		}
   1.110 +	return iText;
   1.111 +	}
   1.112 +
   1.113 +TDesC &TWsDecoder::CommandReplyBuf(const TDesC16 &aDes)
   1.114 +	{
   1.115 +	iOverflowHandler.Reset();
   1.116 +	TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, NULL, &aDes));
   1.117 +	iText=KNullDesC;
   1.118 +	if (details!=KNullDesC)
   1.119 +		{
   1.120 +		iText=LogSpaces;
   1.121 +		TDebugLogTextHandler::Append(iText, details);
   1.122 +		}
   1.123 +	return iText;
   1.124 +	}
   1.125 +
   1.126 +TDesC &TWsDecoder::SignalEvent(TInt aApp)
   1.127 +	{
   1.128 +	iText.Format(_L("Event signalled for App %d"),aApp);
   1.129 +	return iText;
   1.130 +	}
   1.131 +
   1.132 +TDesC &TWsDecoder::Panic(TInt aApp, TInt aReason)
   1.133 +	{
   1.134 +	if (aApp==CDebugLogBase::EDummyConnectionId)
   1.135 +		iText.Format(_L("WSERV Internal Panic (%d)"), aReason);
   1.136 +	else
   1.137 +		iText.Format(_L("App %d, Paniced (%d)"),aApp, aReason);
   1.138 +	return iText;
   1.139 +	}
   1.140 +
   1.141 +void TWsDecoder::UnKnown()
   1.142 +	{
   1.143 +	}
   1.144 +
   1.145 +void TWsDecoder::UnKnownOpcode(TBuf<LogTBufSize> &aText, TInt aOpcode)
   1.146 +	{
   1.147 +	aText.AppendFormat(_L("unknown function (opcode %u)"), aOpcode);
   1.148 +	UnKnown();
   1.149 +	}
   1.150 +
   1.151 +void TWsDecoder::UnKnownReplyBuf(TBuf<LogTBufSize> &aText, TInt aOpcode)
   1.152 +	{
   1.153 +	aText.AppendFormat(_L("unknown reply buffer (opcode %u)"), aOpcode);
   1.154 +	UnKnown();
   1.155 +	}
   1.156 +
   1.157 +TDesC &TWsDecoder::MiscMessage(const TDesC &aFormat,TInt aParam)
   1.158 +	{
   1.159 +	iText.Format(aFormat,aParam);
   1.160 +	return iText;
   1.161 +	}
   1.162 +
   1.163 +void TWsDecoder::AppendPoint(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
   1.164 +	{
   1.165 +	TShortBuf buf(TDebugLogTextHandler::FormatPoint(*((TPoint *)aReplyDes8->Ptr())));
   1.166 +	aText.AppendFormat(LogString, &buf);
   1.167 +	}
   1.168 +
   1.169 +void TWsDecoder::AppendRect(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
   1.170 +	{
   1.171 +	TLongBuf buf(TDebugLogTextHandler::FormatRect(*((TRect *)aReplyDes8->Ptr())));
   1.172 +	aText.AppendFormat(LogString, &buf);
   1.173 +	}
   1.174 +
   1.175 +void TWsDecoder::AppendDesc(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
   1.176 +	{
   1.177 +	TBuf<LogTBufSize> buf;
   1.178 +	buf.Copy(*aReplyDes8);
   1.179 +	aText.AppendFormat(LogString, &buf);
   1.180 +	}
   1.181 +
   1.182 +void TWsDecoder::AppendDesc(TBuf<LogTBufSize> &aText, const TDesC16 *aReplyDes16)
   1.183 +	{
   1.184 +	aText.AppendFormat(LogString, aReplyDes16);
   1.185 +	}
   1.186 +
   1.187 +void TWsDecoder::DecodeWindowGroup(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
   1.188 +	{
   1.189 +	aText.Format(_L("RWindowGroup[%d]::"),aHandle);
   1.190 +	TWsWinCmdUnion pData;
   1.191 +	pData.any=aCmdData;
   1.192 +	switch (aOpcode)
   1.193 +		{
   1.194 +	case EWsWinOpReceiveFocus:
   1.195 +		aText.AppendFormat(_L("ReceiveFocus(%d)"), *pData.Bool);
   1.196 +		break;
   1.197 +	case EWsWinOpAutoForeground:
   1.198 +		aText.AppendFormat(_L("AutoForeground(%d)"), *pData.Bool);
   1.199 +		break;
   1.200 +	case EWsWinOpCancelCaptureKey:
   1.201 +		aText.AppendFormat(_L("CancelCaptureKey(%d)"), *pData.UInt);
   1.202 +		break;
   1.203 +	case EWsWinOpCaptureKey:
   1.204 +		aText.AppendFormat(_L("CaptureKey(%u, 0x%04x, 0x%04x)"),
   1.205 +									pData.CaptureKey->key,
   1.206 +									pData.CaptureKey->modifiers,
   1.207 +									pData.CaptureKey->modifierMask);
   1.208 +		break;
   1.209 +	case EWsWinOpCancelCaptureKeyUpsAndDowns:
   1.210 +		aText.AppendFormat(_L("CancelCaptureKeyUpsAndDowns(%d)"), *pData.UInt);
   1.211 +		break;
   1.212 +	case EWsWinOpCaptureKeyUpsAndDowns:
   1.213 +		aText.AppendFormat(_L("CaptureKeyUpsAndDowns(%u, 0x%04x, 0x%04x)"),
   1.214 +									pData.CaptureKey->key,
   1.215 +									pData.CaptureKey->modifiers,
   1.216 +									pData.CaptureKey->modifierMask);
   1.217 +		break;
   1.218 +	case EWsWinOpSetTextCursor:
   1.219 +		{
   1.220 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos));
   1.221 +		aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x})"),
   1.222 +										hHandleToValue(pData.SetTextCursor->window), &buf,
   1.223 +										pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight,
   1.224 +										pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth,
   1.225 +										pData.SetTextCursor->cursor.iFlags);
   1.226 +		}
   1.227 +		break;
   1.228 +	case EWsWinOpSetTextCursorClipped:
   1.229 +		{
   1.230 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos));
   1.231 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.SetTextCursor->rect));
   1.232 +		aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x}, %S)"),
   1.233 +										hHandleToValue(pData.SetTextCursor->window), &buf1,
   1.234 +										pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight,
   1.235 +										pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth,
   1.236 +										pData.SetTextCursor->cursor.iFlags, &buf2);
   1.237 +		}
   1.238 +		break;
   1.239 +	case EWsWinOpCancelTextCursor:
   1.240 +		aText.AppendFormat(_L("CancelTextCursor()"));
   1.241 +		break;
   1.242 +	case EWsWinOpSetOrdinalPriorityAdjust:
   1.243 +		aText.AppendFormat(_L("SetOrdinalPriorityAdjust(%d)"), *pData.Int);
   1.244 +		break;
   1.245 +	case EWsWinOpAddPriorityKey:
   1.246 +		aText.AppendFormat(_L("AddPriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode);
   1.247 +		break;
   1.248 +	case EWsWinOpRemovePriorityKey:
   1.249 +		aText.AppendFormat(_L("RemovePriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode);
   1.250 +		break;
   1.251 +	case EWsWinOpSetOrdinalPositionErr:
   1.252 +		aText.AppendFormat(_L("SetOrdinalPositionErr(%d, %d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority);	
   1.253 +		break;
   1.254 +	case EWsWinOpDisableKeyClick:
   1.255 +		aText.AppendFormat(_L("DisableKeyClick(%u)"), *pData.UInt);	
   1.256 +		break;
   1.257 +	case EWsWinOpCaptureLongKey:
   1.258 +		aText.AppendFormat(_L("CaptureLongKey(TTimeIntervalMicroSeconds32(%d), %u, %u, %u, %u, %d, %u)"), 
   1.259 +								pData.CaptureLongKey->delay.Int(), pData.CaptureLongKey->inputKey, pData.CaptureLongKey->outputKey, 
   1.260 +								pData.CaptureLongKey->modifierMask, pData.CaptureLongKey->modifiers, pData.CaptureLongKey->priority, pData.CaptureLongKey->flags);	
   1.261 +		break;
   1.262 +	case EWsWinOpCancelCaptureLongKey:
   1.263 +		aText.AppendFormat(_L("CancelCaptureLongKey(%d)"), pData.CaptureKey->key);	
   1.264 +		break;
   1.265 +	case EWsWinOpAllowChildWindowGroup:
   1.266 +		aText.AppendFormat(_L("AllowProcessToCreateChildWindowGroup(%d)"), *pData.Int);	
   1.267 +		break;
   1.268 +	case EWsWinOpClearChildGroup:
   1.269 +		aText.AppendFormat(_L("ClearChildGroup()"));	
   1.270 +		break;
   1.271 +	case EWsWinOpSetChildGroup:
   1.272 +		aText.AppendFormat(_L("SetChildGroup(%d)"), *pData.Int); 	
   1.273 +		break;
   1.274 +	case EWsWinOpEnableVisibilityChangeEvents:
   1.275 +		aText.Append(_L("EnableVisibilityChangeEvents()")); 	
   1.276 +		break;
   1.277 +	case EWsWinOpDisableVisibilityChangeEvents:
   1.278 +		aText.Append(_L("DisableVisibilityChangeEvents()")); 	
   1.279 +		break;
   1.280 +	case EWsWinOpWindowGroupId:
   1.281 +		aText.Append(_L("WindowGroupId()")); 	
   1.282 +		break;
   1.283 +	case EWsWinOpEnableFocusChangeEvents:
   1.284 +		aText.Append(_L("EnableFocusChangeEvents()")); 	
   1.285 +		break;
   1.286 +	case EWsWinOpDisableFocusChangeEvents:
   1.287 +		aText.Append(_L("DisableFocusChangeEvents()")); 	
   1.288 +		break;
   1.289 +	default:
   1.290 +		decodeWindow(aText,aOpcode,aCmdData);
   1.291 +		break;
   1.292 +		}
   1.293 +	}
   1.294 +
   1.295 +void TWsDecoder::DecodeClient(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
   1.296 +	{
   1.297 +	TWsClCmdUnion pData;
   1.298 +
   1.299 +	aText.Format(_L("RWsSession[%d]::"),aHandle);
   1.300 +	pData.any=aCmdData;
   1.301 +	switch (aOpcode)
   1.302 +		{
   1.303 +	case EWsClOpDisconnect:
   1.304 +		aText.AppendFormat(LogClose);
   1.305 +		break;
   1.306 +	case EWsClOpSetHotKey:
   1.307 +		aText.AppendFormat(_L("SetHotKey(%u, %u, 0x%04x, 0x%04x)"),
   1.308 +										pData.SetHotKey->type,
   1.309 +										pData.SetHotKey->keycode,
   1.310 +										pData.SetHotKey->modifiers,
   1.311 +										pData.SetHotKey->modifierMask);
   1.312 +		break;
   1.313 +	case EWsClOpClearHotKeys:
   1.314 +		aText.AppendFormat(_L("ClearHotKeys(%d)"),*pData.UInt);
   1.315 +		break;
   1.316 +	case EWsClOpRestoreDefaultHotKey:
   1.317 +		aText.AppendFormat(_L("ResetDefaultHotKey(%d)"),*pData.UInt);
   1.318 +		break;
   1.319 +	case EWsClOpComputeMode:
   1.320 +		aText.AppendFormat(_L("ComputeMode(%u)"),*pData.UInt);
   1.321 +		break;
   1.322 +	case EWsClOpEventReady:
   1.323 +		aText.AppendFormat(_L("EventReady(TInt *stat)"));
   1.324 +		break;
   1.325 +	case EWsClOpRedrawReady:
   1.326 +		aText.AppendFormat(_L("RedrawReady(TInt *stat)"));
   1.327 +		break;
   1.328 +	case EWsClOpPriorityKeyReady:
   1.329 +		aText.AppendFormat(_L("PriorityKeyReady(TInt *stat)"));
   1.330 +		break;
   1.331 +	case EWsClOpEventReadyCancel:
   1.332 +		aText.AppendFormat(_L("EventReadyCancel()"));
   1.333 +		break;
   1.334 +	case EWsClOpRedrawReadyCancel:
   1.335 +		aText.AppendFormat(_L("RedrawReadyCancel()"));
   1.336 +		break;
   1.337 +	case EWsClOpPriorityKeyReadyCancel:
   1.338 +		aText.AppendFormat(_L("PriorityKeyReadyCancel()"));
   1.339 +		break;
   1.340 +	case EWsClOpGetEvent:
   1.341 +		aText.AppendFormat(_L("GetEvent(TWsEvent *aEvent)"));
   1.342 +		break;
   1.343 +	case EWsClOpGetRedraw:
   1.344 +		aText.AppendFormat(_L("GetRedraw(TWsRedrawEvent *aEvent)"));
   1.345 +		break;
   1.346 +	case EWsClOpGetPriorityKey:
   1.347 +		aText.AppendFormat(_L("GetPriorityKey(TWsPriorityKeyEvent *aEvent)"));
   1.348 +		break;
   1.349 +	case EWsClOpCreateWindow:
   1.350 +	case EWsClOpCreateGc:
   1.351 +	case EWsClOpCreateWindowGroup:
   1.352 +	case EWsClOpCreateAnimDll:
   1.353 +	case EWsClOpCreateScreenDevice:
   1.354 +	case EWsClOpCreateSprite:
   1.355 +	case EWsClOpCreatePointerCursor:
   1.356 +	case EWsClOpCreateBitmap:
   1.357 +	case EWsClOpCreateDirectScreenAccess:
   1.358 +	case EWsClOpCreateClick:
   1.359 +		switch(aOpcode)
   1.360 +			{
   1.361 +			case EWsClOpCreateWindow:
   1.362 +				aText.AppendFormat(_L("CreateWindow(%d,%x)"),hHandleToValue(pData.CreateWindow->parent),pData.CreateWindow->clientHandle);
   1.363 +				break;
   1.364 +			case EWsClOpCreateGc:
   1.365 +				aText.AppendFormat(_L("CreateGc()"));
   1.366 +				break;
   1.367 +			case EWsClOpCreateWindowGroup:
   1.368 +				aText.AppendFormat(_L("CreateWindowGroup(%x)"),pData.CreateWindow->clientHandle);
   1.369 +				break;
   1.370 +			case EWsClOpCreateAnimDll:
   1.371 +				TDebugLogTextHandler::Append(aText, _L("LoadAnimDll(\""));
   1.372 +				if (pData.LoadAnimDll && (pData.LoadAnimDll->length >= 0) && (pData.LoadAnimDll->length < LogTBufSize - 22))
   1.373 +					TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.LoadAnimDll+1), pData.LoadAnimDll->length));
   1.374 +				else
   1.375 +					TDebugLogTextHandler::Append(aText, _L("<INVALID DESCRIPTOR>"));
   1.376 +				TDebugLogTextHandler::Append(aText, _L("\")"));
   1.377 +				break;
   1.378 +			case EWsClOpCreateScreenDevice:
   1.379 +				aText.AppendFormat(_L("CreateScreenDevice()"));
   1.380 +				break;
   1.381 +			case EWsClOpCreateSprite:
   1.382 +				aText.AppendFormat(_L("CreateSprite(...)"));
   1.383 +				break;
   1.384 +			case EWsClOpCreatePointerCursor:
   1.385 +				aText.AppendFormat(_L("CreatePointerCursor(...)"));
   1.386 +				break;
   1.387 +			case EWsClOpCreateBitmap:
   1.388 +				aText.AppendFormat(_L("CreateBitmap(...)"));
   1.389 +				break;
   1.390 +			case EWsClOpCreateDirectScreenAccess:
   1.391 +				aText.AppendFormat(_L("CreateDirectScreenAccess()"));
   1.392 +				break;
   1.393 +			case EWsClOpCreateClick:
   1.394 +				aText.AppendFormat(_L("CreateSoundPlugin()"));
   1.395 +				break;
   1.396 +			}
   1.397 +		break;
   1.398 +	case EWsClOpHeapCount:
   1.399 +		aText.AppendFormat(_L("HeapCount()"));
   1.400 +		break;
   1.401 +	case EWsClOpDebugInfo:
   1.402 +		aText.AppendFormat(_L("DebugInfo(%d,%d)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam);
   1.403 +		break;
   1.404 +	case EWsClOpDebugInfoReplyBuf:
   1.405 +		aText.AppendFormat(_L("DebugInfo(%d,%d,...)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam);
   1.406 +		break;
   1.407 +	case EWsClOpTestInvariant:
   1.408 +		aText.AppendFormat(_L("unimplemented opcode 'EWsClOpTestInvariant' (%u)"), aOpcode);
   1.409 +		break;
   1.410 +	case EWsClOpSetShadowVector:
   1.411 +		{
   1.412 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
   1.413 +		aText.AppendFormat(_L("SetShadowVector(%S)"), &buf);
   1.414 +		break;
   1.415 +		}
   1.416 +	case EWsClOpShadowVector:
   1.417 +		aText.Append(_L("ShadowVector()"));
   1.418 +		break;
   1.419 +	case EWsClOpResourceCount:
   1.420 +		aText.Append(_L("ResourceCount()"));
   1.421 +		break;
   1.422 +	case EWsClOpSetKeyboardRepeatRate:
   1.423 +		aText.Append(_L("SetKeyboardRepeatRate(...,...)"));
   1.424 +		break;
   1.425 +	case EWsClOpGetKeyboardRepeatRate:
   1.426 +		aText.Append(_L("GetKeyboardRepeatRate(...,...)"));
   1.427 +		break;
   1.428 +	case EWsClOpSetDoubleClick:
   1.429 +		aText.AppendFormat(_L("SetDoubleClickSettings(...,%d)"), pData.SetDoubleClick->distance);
   1.430 +		break;
   1.431 +	case EWsClOpGetDoubleClickSettings:
   1.432 +		aText.Append(_L("GetDoubleClickSettings(...,...)"));
   1.433 +		break;
   1.434 +	case EWsClOpHeapSetFail:
   1.435 +		aText.AppendFormat(_L("HeapSetFail(%d, %d)"), pData.HeapSetFail->type, pData.HeapSetFail->value);
   1.436 +		break;
   1.437 +	case EWsClOpNumWindowGroups:
   1.438 +		aText.AppendFormat(_L("NumWindowGroups(%d)"),*pData.UInt);
   1.439 +		break;
   1.440 +	case EWsClOpNumWindowGroupsAllPriorities:
   1.441 +		aText.Append(_L("NumWindowGroups()"));
   1.442 +		break;
   1.443 +	case EWsClOpWindowGroupList:
   1.444 +		aText.AppendFormat(_L("WindowGroupList(...,%d,%d)"),pData.WindowGroupList->priority, pData.WindowGroupList->count);
   1.445 +		break;
   1.446 +	case EWsClOpWindowGroupListAllPriorities:
   1.447 +		aText.AppendFormat(_L("WindowGroupList(...,%d)"),pData.WindowGroupList->count);
   1.448 +		break;
   1.449 +	case EWsClOpGetFocusWindowGroup:
   1.450 +		aText.AppendFormat(_L("GetFocusWindowGroup(%d, ...)"), *pData.UInt);
   1.451 +		break;
   1.452 +	case EWsClOpGetDefaultOwningWindow:
   1.453 +		aText.Append(_L("GetDefaultOwningWindow()"));
   1.454 +		break;
   1.455 +	case EWsClOpSetWindowGroupOrdinalPosition:
   1.456 +		aText.AppendFormat(_L("SetWindowGroupOrdinalPosition(%d, %d)"),
   1.457 +							pData.SetWindowGroupOrdinalPosition->identifier,
   1.458 +							pData.SetWindowGroupOrdinalPosition->position);
   1.459 +		break;
   1.460 +	case EWsClOpGetWindowGroupHandle:
   1.461 +		aText.AppendFormat(_L("GetWindowGroupHandle(%d)"),*pData.Int);
   1.462 +		break;
   1.463 +	case EWsClOpGetWindowGroupOrdinalPriority:
   1.464 +		aText.AppendFormat(_L("GetWindowGroupOrdinalPriority(%d)"),*pData.Int);
   1.465 +		break;
   1.466 +	case EWsClOpGetWindowGroupClientThreadId:
   1.467 +		aText.AppendFormat(_L("GetWindowGroupClientThreadId(%d)"),*pData.Int);
   1.468 +		break;
   1.469 +	case EWsClOpGetWindowGroupNameFromIdentifier:
   1.470 +		aText.AppendFormat(_L("GetWindowGroupNameFromIdentifier(%d)"),pData.GetWindowGroupNameFromIdentifier->identifier);
   1.471 +		break;
   1.472 +	case EWsClOpFindWindowGroupIdentifier:
   1.473 +		aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,...,%d)"),pData.FindWindowGroupIdentifier->identifier,
   1.474 +						pData.FindWindowGroupIdentifier->offset);
   1.475 +		break;
   1.476 +	case EWsClOpFindWindowGroupIdentifierThread:
   1.477 +		aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,0x%x)"),pData.FindWindowGroupIdentifierThread->identifier,
   1.478 +						pData.FindWindowGroupIdentifierThread->threadId.Id());
   1.479 +		break;
   1.480 +	case EWsClOpSendMessageToWindowGroup:
   1.481 +		aText.AppendFormat(_L("SendMessageToWindowGroup(0x%x,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority,
   1.482 +						pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
   1.483 +		break;
   1.484 +	case EWsClOpSendMessageToAllWindowGroups:
   1.485 +		aText.AppendFormat(_L("SendMessageToAllWindowGroups(0x%x,...)"),pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
   1.486 +		break;
   1.487 +	case EWsClOpSendMessageToAllWindowGroupsPriority:
   1.488 +		aText.AppendFormat(_L("SendMessageToAllWindowGroups(%d,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority,
   1.489 +						pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
   1.490 +		break;
   1.491 +	case EWsClOpFetchMessage:
   1.492 +		aText.AppendFormat(_L("FetchMessage(...)"));
   1.493 +		break;
   1.494 +	case EWsClOpSetSystemPointerCursor:
   1.495 +		aText.AppendFormat(_L("SetSystemPointerCursor(...,%d)"), pData.SetSystemPointerCursor->number);
   1.496 +		break;
   1.497 +	case EWsClOpClearSystemPointerCursor:
   1.498 +		aText.AppendFormat(_L("ClearSystemPointerCursor(%d)"), *pData.UInt);
   1.499 +		break;
   1.500 +	case EWsClOpClaimSystemPointerCursorList:
   1.501 +		aText.Append(_L("ClaimSystemPointerCursorList()"));
   1.502 +		break;
   1.503 +	case EWsClOpFreeSystemPointerCursorList:
   1.504 +		aText.Append(_L("FreeSystemPointerCursorList()"));
   1.505 +		break;
   1.506 +	case EWsClOpLogMessage:
   1.507 +		aText.Append(_L("LogMessage(...)"));
   1.508 +		break;
   1.509 +	case EWsClOpPasswordEntered:
   1.510 +		aText.Append(_L("PasswordEntered()"));
   1.511 +		break;
   1.512 +	case EWsClOpPurgePointerEvents:
   1.513 +		aText.Append(_L("PurgePointerEvents()"));
   1.514 +		break;
   1.515 +	case EWsClOpRawEvent:
   1.516 +		aText.AppendFormat(_L("SimulateRawEvent(%d,%d,{{%d,%d},%d})"),((TRawEventX *)pData.RawEvent)->Type(),
   1.517 +								((TRawEventX *)pData.RawEvent)->Ticks(),((TRawEventX *)pData.RawEvent)->posx(),
   1.518 +								((TRawEventX *)pData.RawEvent)->posy(),((TRawEventX *)pData.RawEvent)->scanCode());
   1.519 +		break;
   1.520 +	case EWsClOpSendEventToWindowGroup:
   1.521 +		aText.AppendFormat(_L("SendEventToWindowGroup(%d,"),pData.SendEventToWindowGroup->parameter);
   1.522 +		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
   1.523 +		aText.Append(LogCloseBracket);
   1.524 +		break;
   1.525 +	case EWsClOpSetModifierState:
   1.526 +		aText.AppendFormat(_L("SetModifierState(%d,%d)"), pData.SetModifierState->modifier, pData.SetModifierState->state);
   1.527 +		break;
   1.528 +	case EWsClOpGetModifierState:
   1.529 +		aText.Append(_L("GetModifierState()"));
   1.530 +		break;
   1.531 +	case EWsClOpSendOffEventsToShell:
   1.532 +		{
   1.533 +		_LIT(LogClientSendOffEventsToShell,"RequestOffEvents(%u,%d)");
   1.534 +		aText.AppendFormat(LogClientSendOffEventsToShell
   1.535 +										,pData.OffEventsToShell->on,hHandleToValue(pData.OffEventsToShell->window));
   1.536 +		}
   1.537 +		break;
   1.538 +	case EWsClOpGetDefModeMaxNumColors:
   1.539 +		{
   1.540 +		_LIT(LogClientGetDefModeMaxNumColors,"GetDefModeMaxNumColors()");
   1.541 +		aText.Append(LogClientGetDefModeMaxNumColors);
   1.542 +		}
   1.543 +		break;
   1.544 +	case EWsClOpGetColorModeList:
   1.545 +		{
   1.546 +		_LIT(LogClientGetColorModeList,"GetColorModeList()");
   1.547 +		aText.Append(LogClientGetColorModeList);
   1.548 +		}
   1.549 +		break;
   1.550 +	case EWsClOpKeyEvent:
   1.551 +		{
   1.552 +		_LIT(LogClientKeyEvent,"SimulateKeyEvent(%d)");
   1.553 +		aText.AppendFormat(LogClientKeyEvent,pData.KeyEvent->iCode);
   1.554 +		}
   1.555 +		break;
   1.556 +	case EWsClOpSendEventToAllWindowGroup:
   1.557 +		{
   1.558 +		_LIT(LogClientSendEventToAllWindowGroups,"SendEventToAllWindowGroups(");
   1.559 +		aText.Append(LogClientSendEventToAllWindowGroups);
   1.560 +		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
   1.561 +		aText.Append(LogCloseBracket);
   1.562 +		}
   1.563 +		break;
   1.564 +	case EWsClOpSendEventToAllWindowGroupPriority:
   1.565 +		{
   1.566 +		_LIT(LogClientSendEventToAllWindowGroupPriority,"SendEventToAllWindowGroups(%d,");
   1.567 +		aText.AppendFormat(LogClientSendEventToAllWindowGroupPriority,pData.SendEventToWindowGroup->parameter);
   1.568 +		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
   1.569 +		aText.Append(LogCloseBracket);
   1.570 +		}
   1.571 +		break;
   1.572 +	case EWsClOpSetPointerCursorArea:
   1.573 +		{
   1.574 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.SetPointerCursorArea->area));
   1.575 +		_LIT(LogClientSetPointerCursorArea,"SetPointerCursorArea(%d,%S)");
   1.576 +		aText.AppendFormat(LogClientSetPointerCursorArea,pData.SetPointerCursorArea->mode,&buf);
   1.577 +		}
   1.578 +		break;
   1.579 +	case EWsClOpPointerCursorArea:
   1.580 +		{
   1.581 +		_LIT(LogClientPointerCursorArea,"PointerCursorArea(%d)");
   1.582 +		aText.AppendFormat(LogClientPointerCursorArea,*pData.Int);
   1.583 +		}
   1.584 +		break;
   1.585 +	case EWsClOpSetPointerCursorMode:
   1.586 +		{
   1.587 +		_LIT(LogClientSetPointerCursorMode,"SetPointerCursorMode(%d)");
   1.588 +		aText.AppendFormat(LogClientSetPointerCursorMode,*pData.Mode);
   1.589 +		}
   1.590 +		break;
   1.591 +	case EWsClOpPointerCursorMode:
   1.592 +		{
   1.593 +		_LIT(LogClientPointerCursorMode,"PointerCursorMode()");
   1.594 +		aText.Append(LogClientPointerCursorMode);
   1.595 +		}
   1.596 +		break;
   1.597 +	case EWsClOpSetDefaultSystemPointerCursor:
   1.598 +		{
   1.599 +		_LIT(LogClientSetDefaultSystemPointerCursor,"SetDefaultSystemPointerCursor(%d)");
   1.600 +		aText.AppendFormat(LogClientSetDefaultSystemPointerCursor,*pData.Int);
   1.601 +		}
   1.602 +		break;
   1.603 +	case EWsClOpClearDefaultSystemPointerCursor:
   1.604 +		{
   1.605 +		_LIT(LogClientClearDefaultSystemPointerCursor,"ClearDefaultSystemPointerCursor()");
   1.606 +		aText.Append(LogClientClearDefaultSystemPointerCursor);
   1.607 +		}
   1.608 +		break;
   1.609 +	case EWsClOpSetPointerCursorPosition:
   1.610 +		{
   1.611 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
   1.612 +		_LIT(LogClientSetPointerCursorPosition,"SetPointerCursorPosition(%S)");
   1.613 +		aText.AppendFormat(LogClientSetPointerCursorPosition,&buf);
   1.614 +		}
   1.615 +		break;
   1.616 +	case EWsClOpPointerCursorPosition:
   1.617 +		{
   1.618 +		_LIT(LogClientPointerCursorPosition,"PointerCursorPosition()");
   1.619 +		aText.Append(LogClientPointerCursorPosition);
   1.620 +		}
   1.621 +		break;
   1.622 +	case EWsClOpSetDefaultFadingParams:
   1.623 +		{
   1.624 +		_LIT(LogClientSetDefaultFadingParams,"SetDefaultFadingParameters(%d,%d)");
   1.625 +		aText.AppendFormat(LogClientSetDefaultFadingParams
   1.626 +								,WservEncoding::ExtractFirst8BitValue(*pData.UInt),WservEncoding::ExtractSecond8BitValue(*pData.UInt));
   1.627 +		}
   1.628 +		break;
   1.629 +	case EWsClOpPrepareForSwitchOff:
   1.630 +		{
   1.631 +		_LIT(LogClientPrepareForSwitchOff,"PrepareForSwitchOff()");
   1.632 +		aText.Append(LogClientPrepareForSwitchOff);
   1.633 +		}
   1.634 +		break;
   1.635 +	case EWsClOpSetFaded:
   1.636 +		{
   1.637 +		_LIT(LogWinSetFade,"SetSystemFade(%d");
   1.638 +		aText.AppendFormat(LogWinSetFade,pData.SetSystemFaded->Faded());
   1.639 +		if (!pData.SetSystemFaded->UseDefaultMap())
   1.640 +			{
   1.641 +			_LIT(LogWinSetFade2,",%d,%d");
   1.642 +			TUint8 blackMap;
   1.643 +			TUint8 whiteMap;
   1.644 +			pData.SetSystemFaded->GetFadingParams(blackMap,whiteMap);
   1.645 +			aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap);
   1.646 +			}
   1.647 +		aText.Append(LogCloseBracket);
   1.648 +		}
   1.649 +		break;
   1.650 +	case EWsClOpLogCommand:
   1.651 +		{
   1.652 +		_LIT(LogClientLogCommand,"LogCommand(%d)");
   1.653 +		aText.AppendFormat(LogClientLogCommand,*pData.UInt);
   1.654 +		}
   1.655 +		break;
   1.656 +	case EWsClOpSendEventToOneWindowGroupPerClient:
   1.657 +		{
   1.658 +		_LIT(LogClientSendEventToOneWindowGroupPerClient,"SendEventToOneWindowGroupsPerClient(");
   1.659 +		aText.Append(LogClientSendEventToOneWindowGroupPerClient);
   1.660 +		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
   1.661 +		aText.Append(LogCloseBracket);
   1.662 +		}
   1.663 +		break;
   1.664 +	case EWsClOpStartSetCustomTextCursor:
   1.665 +		{
   1.666 +		_LIT(LogClientStartSetCustomTextCursor,"StartSetCustomTextCursorL(id=0x%08x, flags=0x%08x, align=%d)");
   1.667 +		aText.AppendFormat(LogClientStartSetCustomTextCursor, pData.CustomTextCursorData->identifier, pData.CustomTextCursorData->flags, pData.CustomTextCursorData->alignment);
   1.668 +		}
   1.669 +		break;
   1.670 +	case EWsClOpCompleteSetCustomTextCursor:
   1.671 +		{
   1.672 +		_LIT(LogClientCompleteSetCustomTextCursor,"CompleteSetCustomTextCursorL(err=%d)");
   1.673 +		aText.AppendFormat(LogClientCompleteSetCustomTextCursor, *pData.Int);
   1.674 +		}
   1.675 +		break;
   1.676 +#if defined(__WINS__)
   1.677 +	case EWsClOpRemoveKeyCode:
   1.678 +		{
   1.679 +		_LIT(LogClientRemoveKeyCode,"RemoveKeyCode(%d)");
   1.680 +		aText.AppendFormat(LogClientRemoveKeyCode,*pData.UInt);
   1.681 +		}
   1.682 +		break;
   1.683 +	case EWsClOpSimulateXyInput:
   1.684 +		{
   1.685 +		_LIT(LogClientSimulateXyInput,"SimulateXyInputType(%d)");
   1.686 +		aText.AppendFormat(LogClientSimulateXyInput,*pData.UInt);
   1.687 +		}
   1.688 +		break;
   1.689 +#endif
   1.690 +	case EWsClOpSetBackgroundColor:
   1.691 +		{		
   1.692 +		TShortBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
   1.693 +		_LIT(LogClientSetBackgroundColor,"SetBackgroundColor(%S)");
   1.694 +		aText.AppendFormat(LogClientSetBackgroundColor,&buf);
   1.695 +		}
   1.696 +		break;
   1.697 +	case EWsClOpGetBackgroundColor:
   1.698 +		{		
   1.699 +		_LIT(LogClientGetBackgroundColor,"GetBackgroundColor()");
   1.700 +		aText.AppendFormat(LogClientGetBackgroundColor);
   1.701 +		}
   1.702 +		break;
   1.703 +	case EWsClOpSystemInfo:
   1.704 +		{		
   1.705 +		_LIT(LogClientSystemInfo,"SystemInfo(%d, SSystemInfo &aSystemInfo)");
   1.706 +		aText.AppendFormat(LogClientSystemInfo, *pData.UInt);
   1.707 +		}
   1.708 +		break;
   1.709 +	case EWsClOpSetFocusScreen:
   1.710 +		{		
   1.711 +		_LIT(LogClientSetFocusScreen,"SetFocusScreen(%d)");
   1.712 +		aText.AppendFormat(LogClientSetFocusScreen, *pData.UInt);
   1.713 +		}
   1.714 +		break;
   1.715 +	case EWsClOpGetFocusScreen:
   1.716 +		{		
   1.717 +		_LIT(LogClientGetFocusScreen,"GetFocusScreen()");
   1.718 +		aText.AppendFormat(LogClientGetFocusScreen);
   1.719 +		}
   1.720 +		break;
   1.721 +	case EWsClOpWindowGroupListAndChain:
   1.722 +		{		
   1.723 +		_LIT(LogClientWindowGroupListAndChain,"WindowGroupList(%d, RArray<TWindowGroupChainInfo>* aWindowList)");
   1.724 +		aText.AppendFormat(LogClientWindowGroupListAndChain, *pData.UInt);
   1.725 +		}
   1.726 +		break;
   1.727 +	case EWsClOpWindowGroupListAndChainAllPriorities:
   1.728 +		{		
   1.729 +		_LIT(LogClientWindowGroupListAndChainAllPriorities,"WindowGroupListAndChainAllPriorities(RArray<TWindowGroupChainInfo>* aWindowList)");
   1.730 +		aText.AppendFormat(LogClientWindowGroupListAndChainAllPriorities);
   1.731 +		}
   1.732 +		break;
   1.733 +	case EWsClOpSetClientCursorMode:
   1.734 +		{		
   1.735 +		_LIT(LogClientSetClientCursorMode,"SetClientCursorMode(%d)");
   1.736 +		aText.AppendFormat(LogClientSetClientCursorMode, *pData.UInt);
   1.737 +		}
   1.738 +		break;
   1.739 +	case EWsClOpClearAllRedrawStores:
   1.740 +		{		
   1.741 +		_LIT(LogClientClearAllRedrawStores,"ClearAllRedrawStores()");
   1.742 +		aText.AppendFormat(LogClientClearAllRedrawStores);
   1.743 +		}
   1.744 +		break;
   1.745 +	case EWsClOpGraphicMessageReady:
   1.746 +		{		
   1.747 +		_LIT(LogClientGraphicMessageReady,"GraphicMessageReady(%d)");
   1.748 +		aText.AppendFormat(LogClientGraphicMessageReady, *pData.UInt);	
   1.749 +		}
   1.750 +		break;
   1.751 +	case EWsClOpGetGraphicMessage:
   1.752 +		{		
   1.753 +		_LIT(LogClientGraphicMessage,"GetGraphicMessage(%d)");
   1.754 +		aText.AppendFormat(LogClientGraphicMessage, *pData.UInt);	
   1.755 +		}
   1.756 +		break;
   1.757 +	case EWsClOpGraphicMessageCancel:
   1.758 +		{		
   1.759 +		_LIT(LogClientGraphicMessageCancel,"GraphicMessageCancel()");
   1.760 +		aText.AppendFormat(LogClientGraphicMessageCancel);	
   1.761 +		}
   1.762 +		break;		
   1.763 +	case EWsClOpNumWindowGroupsOnScreen:
   1.764 +		{		
   1.765 +		_LIT(LogClientNumWindowGroupsOnScreen,"NumWindowGroups(%d, %d)");
   1.766 +		aText.AppendFormat(LogClientNumWindowGroupsOnScreen, pData.NumWinGroups->screenNumber, pData.NumWinGroups->priority);
   1.767 +		}
   1.768 +		break;
   1.769 +	case EWsClOpGetNumberOfScreens:
   1.770 +		{		
   1.771 +		_LIT(LogClientGetNumberOfScreens,"NumberOfScreens()");
   1.772 +		aText.AppendFormat(LogClientGetNumberOfScreens);		
   1.773 +		}
   1.774 +		break;
   1.775 +	case EWsClOpNoFlickerFree:
   1.776 +		{		
   1.777 +		_LIT(LogNoFlickerFree,"EWsClOpNoFlickerFree enum");
   1.778 +		aText.AppendFormat(LogNoFlickerFree);		
   1.779 +		}
   1.780 +		break;
   1.781 +	case EWsClOpCreateGraphic:
   1.782 +		{		
   1.783 +		_LIT(LogCreateGraphic,"EWsClOpCreateGraphic enum");
   1.784 +		aText.AppendFormat(LogCreateGraphic);		
   1.785 +		}
   1.786 +		break;
   1.787 +	case EWsClOpRegisterSurface:
   1.788 +		{
   1.789 +		TInt screenNumber = pData.SurfaceRegister->screenNumber;
   1.790 +		const TSurfaceId& surfaceId = pData.SurfaceRegister->surfaceId;
   1.791 +		
   1.792 +		_LIT(LogRegisterSurface,"RegisterSurface(aScreenNumber(%d), TSurfaceId{%x,%x,%x,%x})");
   1.793 +		aText.AppendFormat(LogRegisterSurface, screenNumber, surfaceId.iInternal[0], surfaceId.iInternal[1], surfaceId.iInternal[2], surfaceId.iInternal[3]);
   1.794 +		}
   1.795 +		break;
   1.796 +	case EWsClOpUnregisterSurface:
   1.797 +		{
   1.798 +		TInt screenNumber = pData.SurfaceRegister->screenNumber;
   1.799 +		const TSurfaceId& surfaceId = pData.SurfaceRegister->surfaceId;
   1.800 +		
   1.801 +		_LIT(LogUnregisterSurface,"UnregisterSurface(aScreenNumber(%d), TSurfaceId{%x,%x,%x,%x})");
   1.802 +		aText.AppendFormat(LogUnregisterSurface, screenNumber, surfaceId.iInternal[0], surfaceId.iInternal[1], surfaceId.iInternal[2], surfaceId.iInternal[3]);
   1.803 +		}
   1.804 +		break;
   1.805 +	case EWsClOpSetCloseProximityThresholds:
   1.806 +		{
   1.807 +		_LIT(LogSetCloseProximityThresholds,"SetCloseProximityThresholds(%d, %d)");
   1.808 +		aText.AppendFormat(LogSetCloseProximityThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold);
   1.809 +		}
   1.810 +		break;	
   1.811 +	case EWsClOpSetHighPressureThresholds:
   1.812 +		{
   1.813 +		_LIT(LogSetHighPressureThresholds,"SetHighPressureThresholds(%d, %d)");
   1.814 +		aText.AppendFormat(LogSetHighPressureThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold);	
   1.815 +		}
   1.816 +		break;
   1.817 +	case EWsClOpGetEnterCloseProximityThreshold:
   1.818 +		{		
   1.819 +		_LIT(LogGetEnterCloseProximityThreshold,"EWsClOpGetEnterCloseProximityThreshold()");
   1.820 +		aText.AppendFormat(LogGetEnterCloseProximityThreshold);		
   1.821 +		}
   1.822 +		break;	
   1.823 +	case EWsClOpGetExitCloseProximityThreshold:
   1.824 +		{		
   1.825 +		_LIT(LogGetExitCloseProximityThreshold,"EWsClOpGetExitCloseProximityThreshold()");
   1.826 +		aText.AppendFormat(LogGetExitCloseProximityThreshold);		
   1.827 +		}
   1.828 +		break;
   1.829 +	case EWsClOpGetEnterHighPressureThreshold:
   1.830 +		{		
   1.831 +		_LIT(LogGetEnterHighPressureThreshold,"EWsClOpGetEnterHighPressureThreshold()");
   1.832 +		aText.AppendFormat(LogGetEnterHighPressureThreshold);		
   1.833 +		}
   1.834 +		break;	
   1.835 +	case EWsClOpGetExitHighPressureThreshold:
   1.836 +		{		
   1.837 +		_LIT(LogGetExitHighPressureThreshold,"EWsClOpGetExitHighPressureThreshold()");
   1.838 +		aText.AppendFormat(LogGetExitHighPressureThreshold);		
   1.839 +		}
   1.840 +		break;
   1.841 +	case EWsClOpIndicateAppOrientation:
   1.842 +	    {
   1.843 +        _LIT(LogIndicateAppOrientation,"EWsClOpIndicateAppOrientation(%d)");
   1.844 +        aText.AppendFormat(LogIndicateAppOrientation, *pData.Orientation);       	    
   1.845 +	    }
   1.846 +	    break;
   1.847 +	case EWsClOpLastEnumValue:
   1.848 +		{		
   1.849 +		_LIT(LogLastEnumValue,"EWsClOpLastEnumValue enum");
   1.850 +		aText.AppendFormat(LogLastEnumValue);		
   1.851 +		}
   1.852 +		break;
   1.853 +	default:
   1.854 +		UnKnownOpcode(aText, aOpcode);
   1.855 +		break;
   1.856 +		}
   1.857 +	}
   1.858 +
   1.859 +void TWsDecoder::DecodeWindow(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
   1.860 +	{
   1.861 +	_LIT(LogWindow,"RWindow[%d]::");
   1.862 +	aText.Format(LogWindow,aHandle);
   1.863 +	decodeWindow(aText,aOpcode,aCmdData);
   1.864 +	}
   1.865 +
   1.866 +void TWsDecoder::decodeWindow(TBuf<LogTBufSize> &aText,TInt aOpcode,const TAny *aData)
   1.867 +	{
   1.868 +	TWsWinCmdUnion pData;
   1.869 +	pData.any=aData;
   1.870 +	switch (aOpcode)
   1.871 +		{
   1.872 +	case EWsWinOpFree:
   1.873 +		aText.AppendFormat(LogClose);
   1.874 +		break;
   1.875 +	case EWsWinOpSetExtent:
   1.876 +		{
   1.877 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos));
   1.878 +		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size));
   1.879 +		aText.AppendFormat(_L("SetExtent(%S, %S)"), &buf1, &buf2);
   1.880 +		}
   1.881 +		break;
   1.882 +	case EWsWinOpSetExtentErr:
   1.883 +		{
   1.884 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos));
   1.885 +		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size));
   1.886 +		aText.AppendFormat(_L("SetExtentError(%S, %S)"), &buf1, &buf2);
   1.887 +		}
   1.888 +		break;
   1.889 +	case EWsWinOpOrdinalPosition:
   1.890 +		aText.AppendFormat(_L("OrdinalPosition()"));
   1.891 +		break;
   1.892 +	case EWsWinOpFullOrdinalPosition:
   1.893 +		aText.AppendFormat(_L("FullOrdinalPosition()"));
   1.894 +		break;
   1.895 +	case EWsWinOpSetOrdinalPosition:
   1.896 +		aText.AppendFormat(_L("SetOrdinalPosition(%d)"),*pData.Int);
   1.897 +		break;
   1.898 +	case EWsWinOpSetOrdinalPositionPri:
   1.899 +		aText.AppendFormat(_L("SetOrdinalPosition(%d,%d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority);
   1.900 +		break;
   1.901 +	case EWsWinOpSetPos:
   1.902 +		{
   1.903 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.pos));
   1.904 +		aText.AppendFormat(_L("SetPosition(%S)"),&buf);
   1.905 +		}
   1.906 +		break;
   1.907 +	case EWsWinOpSetSizeErr:
   1.908 +		{
   1.909 +		TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size));
   1.910 +		aText.AppendFormat(_L("SetSizeErr(%S)"), &buf);
   1.911 +		}
   1.912 +		break;
   1.913 +	case EWsWinOpSetSize:
   1.914 +		{
   1.915 +		TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size));
   1.916 +		aText.AppendFormat(_L("SetSize(%S)"), &buf);
   1.917 +		}
   1.918 +		break;
   1.919 +	case EWsWinOpPosition:
   1.920 +		aText.AppendFormat(_L("Position()"));
   1.921 +		break;
   1.922 +	case EWsWinOpAbsPosition:
   1.923 +		aText.AppendFormat(_L("AbsPosition()"));
   1.924 +		break;
   1.925 +	case EWsWinOpSize:
   1.926 +		aText.AppendFormat(_L("Size()"));
   1.927 +		break;
   1.928 +	case EWsWinOpActivate:
   1.929 +		aText.AppendFormat(_L("Activate()"));
   1.930 +		break;
   1.931 +	case EWsWinOpInvalidate:
   1.932 +		{
   1.933 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect));
   1.934 +		aText.AppendFormat(_L("Invalidate(%S)"), &buf);
   1.935 +		}
   1.936 +		break;
   1.937 +	case EWsWinOpInvalidateFull:
   1.938 +		aText.AppendFormat(_L("Invalidate()"));
   1.939 +		break;
   1.940 +	case EWsWinOpBeginRedraw:
   1.941 +		{
   1.942 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect));
   1.943 +		aText.AppendFormat(_L("BeginRedraw(%S)"), &buf);
   1.944 +		}
   1.945 +		break;
   1.946 +	case EWsWinOpBeginRedrawFull:
   1.947 +		aText.AppendFormat(_L("BeginRedraw()"));
   1.948 +		break;
   1.949 +	case EWsWinOpEndRedraw:
   1.950 +		aText.AppendFormat(_L("EndRedraw()"));
   1.951 +		break;
   1.952 +	case EWsWinOpTestInvariant:
   1.953 +		aText.AppendFormat(_L("__TestInvariant()"));
   1.954 +		break;
   1.955 +	case EWsWinOpParent:
   1.956 +		aText.AppendFormat(_L("Parent()"));
   1.957 +		break;
   1.958 +	case EWsWinOpNextSibling:
   1.959 +		aText.AppendFormat(_L("NextSibling()"));
   1.960 +		break;
   1.961 +	case EWsWinOpPrevSibling:
   1.962 +		aText.AppendFormat(_L("PrevSibling()"));
   1.963 +		break;
   1.964 +	case EWsWinOpChild:
   1.965 +		aText.AppendFormat(_L("Child()"));
   1.966 +		break;
   1.967 +	case EWsWinOpInquireOffset:
   1.968 +		aText.AppendFormat(_L("InquireOffset(%d)"),hHandleToValue(*pData.UInt));
   1.969 +		break;
   1.970 +	case EWsWinOpPointerFilter:
   1.971 +		aText.AppendFormat(_L("PointerFilter(0x%08x)"), *pData.UInt);
   1.972 +		break;
   1.973 +	case EWsWinOpSetPointerCapture:
   1.974 +		aText.AppendFormat(_L("SetPointerCapture(%u)"), *pData.UInt);
   1.975 +		break;
   1.976 +	case EWsWinOpSetPointerGrab:
   1.977 +		aText.AppendFormat(_L("SetPointerGrab(%u)"), *pData.UInt);
   1.978 +		break;
   1.979 +	case EWsWinOpSetNoBackgroundColor:
   1.980 +		aText.Append(_L("SetBackgroundColor()"));
   1.981 +		break;
   1.982 +	case EWsWinOpSetBackgroundColor:
   1.983 +		{
   1.984 +		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
   1.985 +		aText.AppendFormat(_L("SetBackgroundColor(%S)"), &buf);
   1.986 +		}
   1.987 +		break;
   1.988 +	case EWsWinOpSetColor:
   1.989 +		{
   1.990 +		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
   1.991 +		aText.AppendFormat(_L("SetColor(%S)"), &buf);
   1.992 +		}
   1.993 +		break;
   1.994 +	case EWsWinOpSetShadowHeight:
   1.995 +		aText.AppendFormat(_L("SetShadowHeight(%d)"), *pData.Int);
   1.996 +		break;
   1.997 +	case EWsWinOpShadowDisabled:
   1.998 +		{
   1.999 +		TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool));
  1.1000 +		aText.AppendFormat(_L("SetShadowDisabled(%S)"), &buf);
  1.1001 +		}
  1.1002 +		break;
  1.1003 +	case EWsWinOpSetVisible:
  1.1004 +		{
  1.1005 +		TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool));
  1.1006 +		aText.AppendFormat(_L("SetVisible(%S)"), &buf);
  1.1007 +		}
  1.1008 +		break;
  1.1009 +	case EWsWinOpUpdateScreen:
  1.1010 +		aText.Append(_L("UpdateScreen()"));
  1.1011 +		break;
  1.1012 +	case EWsWinOpUpdateScreenRegion:
  1.1013 +		aText.Append(_L("UpdateScreenRegion(TRegion(...))"));
  1.1014 +		break;
  1.1015 +	case EWsWinOpMaintainBackup:
  1.1016 +		aText.Append(_L("MaintainBackup()"));
  1.1017 +		break;
  1.1018 +	case EWsWinOpGetInvalidRegion:
  1.1019 +		aText.Append(_L("GetInvalidRegion(...)"));
  1.1020 +		break;
  1.1021 +	case EWsWinOpGetInvalidRegionCount:
  1.1022 +		aText.Append(_L("GetInvalidRegionCount()"));
  1.1023 +		break;
  1.1024 +	case EWsWinOpScroll:
  1.1025 +		{
  1.1026 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
  1.1027 +		aText.AppendFormat(_L("Scroll(%S)"), &buf);
  1.1028 +		}
  1.1029 +		break;
  1.1030 +	case EWsWinOpScrollClip:
  1.1031 +		{
  1.1032 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip));
  1.1033 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
  1.1034 +		aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2);
  1.1035 +		}
  1.1036 +		break;
  1.1037 +	case EWsWinOpScrollRect:
  1.1038 +		{
  1.1039 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
  1.1040 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect));
  1.1041 +		aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2);
  1.1042 +		}
  1.1043 +		break;
  1.1044 +	case EWsWinOpScrollClipRect:
  1.1045 +		{
  1.1046 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip));
  1.1047 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
  1.1048 +		TLongBuf buf3(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect));
  1.1049 +		aText.AppendFormat(_L("Scroll(%S, %S, %S)"), &buf1, &buf2, &buf3);
  1.1050 +		}
  1.1051 +		break;
  1.1052 +	case EWsWinOpBitmapHandle:
  1.1053 +		aText.Append(_L("BitmapHandle()"));
  1.1054 +		break;
  1.1055 +	case EWsWinOpUpdateBackupBitmap:
  1.1056 +		aText.Append(_L("UpdateBackupBitmap()"));
  1.1057 +		break;
  1.1058 +	case EWsWinOpRequiredDisplayMode:
  1.1059 +		aText.AppendFormat(_L("SetRequiredDisplayMode(%d)"), *pData.UInt);
  1.1060 +		break;
  1.1061 +	case EWsWinOpSetCornerType:
  1.1062 +		aText.AppendFormat(_L("SetCornerType(%d)"), *pData.UInt);
  1.1063 +		break;
  1.1064 +	case EWsWinOpSetShape:
  1.1065 +		aText.AppendFormat(_L("SetWindowShape(%d rects)"), pData.SetShape->count);
  1.1066 +		break;
  1.1067 +	case EWsWinOpSetName:
  1.1068 +		aText.Append(_L("SetName(\"...\")"));
  1.1069 +		break;
  1.1070 +	case EWsWinOpName:
  1.1071 +		aText.Append(_L("Name()"));
  1.1072 +		break;
  1.1073 +	case EWsWinOpSetOwningWindowGroup:
  1.1074 +		aText.AppendFormat(_L("SetOwningWindowGroup(%d)"),*pData.Int);
  1.1075 +		break;
  1.1076 +	case EWsWinOpDefaultOwningWindow:
  1.1077 +		aText.Append(_L("DefaultOwningWindow()"));
  1.1078 +		break;
  1.1079 +	case EWsWinOpEnableOnEvents:
  1.1080 +		aText.AppendFormat(_L("EnableOnEvents(%d)"),*pData.Int);
  1.1081 +		break;
  1.1082 +	case EWsWinOpDisableOnEvents:
  1.1083 +		aText.Append(_L("DisableOnEvents()"));
  1.1084 +		break;
  1.1085 +	case EWsWinOpEnableErrorMessages:
  1.1086 +		aText.AppendFormat(_L("EnableErrorMessages(%d)"),*pData.Int);
  1.1087 +		break;
  1.1088 +	case EWsWinOpDisableErrorMessages:
  1.1089 +		aText.Append(_L("DisableErrorMessages()"));
  1.1090 +		break;
  1.1091 +	case EWsWinOpEnableModifierChangedEvents:
  1.1092 +		aText.Append(_L("EnableModifierChangedEvents()"));
  1.1093 +		break;
  1.1094 +	case EWsWinOpDisableModifierChangedEvents:
  1.1095 +		aText.Append(_L("DisableModifierChangedEvents()"));
  1.1096 +		break;
  1.1097 +	case EWsWinOpEnableGroupChangeEvents:
  1.1098 +		aText.Append(_L("EnableGroupChangeEvents()"));
  1.1099 +		break;
  1.1100 +	case EWsWinOpDisableGroupChangeEvents:
  1.1101 +		aText.Append(_L("DisableGroupChangeEvents()"));
  1.1102 +		break;
  1.1103 +	case EWsWinOpRequestPointerRepeatEvent:
  1.1104 +		{
  1.1105 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.RequestPointerRepeatEvent->rect));
  1.1106 +		aText.AppendFormat(_L("RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(%d), %S)"), 
  1.1107 +								pData.RequestPointerRepeatEvent->time.Int(), &buf);
  1.1108 +		}
  1.1109 +		break;
  1.1110 +	case EWsWinOpCancelPointerRepeatEventRequest:
  1.1111 +		aText.Append(_L("CancelPointerRepeatEventRequest()"));
  1.1112 +		break;
  1.1113 +	case EWsWinOpSetPointerCursor:
  1.1114 +		aText.AppendFormat(_L("SetPointerCursor(%d)"),*pData.UInt);
  1.1115 +		break;
  1.1116 +	case EWsWinOpSetCustomPointerCursor:
  1.1117 +		aText.AppendFormat(_L("SetCustomPointerCursor(%d)"),*pData.UInt);
  1.1118 +		break;
  1.1119 +	case EWsWinOpPasswordWindow:
  1.1120 +		aText.AppendFormat(_L("PasswordWindow(%d)"),*pData.PasswordMode);
  1.1121 +		break;
  1.1122 +	case EWsWinOpAddKeyRect:
  1.1123 +		{
  1.1124 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.AddKeyRect->rect));
  1.1125 +		aText.AppendFormat(_L("AddKeyRect(%S,%d,%d)"),&buf,pData.AddKeyRect->scanCode,pData.AddKeyRect->activatedByPointerSwitchOn);
  1.1126 +		}
  1.1127 +		break;
  1.1128 +	case EWsWinOpRemoveAllKeyRects:
  1.1129 +		aText.Append(_L("RemoveAllKeyRects()"));
  1.1130 +		break;
  1.1131 +	case EWsWinOpAllocPointerMoveBuffer:
  1.1132 +		aText.AppendFormat(_L("AllocPointerMoveBuffer(%d,%d)"),pData.AllocPointerMoveBuffer->maxNumPoints,pData.AllocPointerMoveBuffer->flags);
  1.1133 +		break;
  1.1134 +	case EWsWinOpFreePointerMoveBuffer:
  1.1135 +		aText.Append(_L("FreePointerMoveBuffer()"));
  1.1136 +		break;
  1.1137 +	case EWsWinOpEnablePointerMoveBuffer:
  1.1138 +		aText.Append(_L("EnablePointerMoveBuffer()"));
  1.1139 +		break;
  1.1140 +	case EWsWinOpDisablePointerMoveBuffer:
  1.1141 +		aText.Append(_L("DisablePointerMoveBuffer()"));
  1.1142 +		break;
  1.1143 +	case EWsWinOpRetrievePointerMoveBuffer:
  1.1144 +		aText.Append(_L("RetrievePointerMoveBuffer(...)"));
  1.1145 +		break;
  1.1146 +	case EWsWinOpDiscardPointerMoveBuffer:
  1.1147 +		aText.Append(_L("DiscardPointerMoveBuffer()"));
  1.1148 +		break;
  1.1149 +	case EWsWinOpEnableBackup:
  1.1150 +		aText.Append(_L("EnableBackup()"));
  1.1151 +		break;
  1.1152 +	case EWsWinOpClaimPointerGrab:
  1.1153 +		aText.Append(_L("ClaimPointerGrab()"));
  1.1154 +		break;
  1.1155 +	case EWsWinOpIdentifier:
  1.1156 +		aText.Append(_L("Identifier()"));
  1.1157 +		break;
  1.1158 +	case EWsWinOpSetFade:
  1.1159 +		{
  1.1160 +		_LIT(LogWinSetFade,"SetFade(%d,%d");
  1.1161 +		aText.AppendFormat(LogWinSetFade,pData.SetFaded->Faded(),pData.SetFaded->IncludeChildren());
  1.1162 +		if (!pData.SetFaded->UseDefaultMap())
  1.1163 +			{
  1.1164 +			_LIT(LogWinSetFade2,",%d,%d");
  1.1165 +			TUint8 blackMap;
  1.1166 +			TUint8 whiteMap;
  1.1167 +			pData.SetFaded->GetFadingParams(blackMap,whiteMap);
  1.1168 +			aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap);
  1.1169 +			}
  1.1170 +		aText.Append(LogCloseBracket);
  1.1171 +		}
  1.1172 +		break;
  1.1173 +	case EWsWinOpSetNonFading:
  1.1174 +		{
  1.1175 +		_LIT(LogWinSetNonFading,"SetNonFading(%d)");
  1.1176 +		aText.AppendFormat(LogWinSetNonFading,*(pData.Bool));
  1.1177 +		}
  1.1178 +		break;
  1.1179 +	case EWsWinOpFadeBehind:
  1.1180 +		{
  1.1181 +		_LIT(LogWinFadeBehind,"FadeBehind(%d)");
  1.1182 +		aText.AppendFormat(LogWinFadeBehind,*(pData.Bool));
  1.1183 +		}
  1.1184 +		break;
  1.1185 +	case EWsWinOpEnableScreenChangeEvents:
  1.1186 +		{
  1.1187 +		_LIT(LogWinEnableScreenChangeEvents,"EnableScreenChangeEvents()");
  1.1188 +		aText.Append(LogWinEnableScreenChangeEvents);
  1.1189 +		}
  1.1190 +		break;
  1.1191 +	case EWsWinOpDisableScreenChangeEvents:
  1.1192 +		{
  1.1193 +		_LIT(LogWinDisableScreenChangeEvents,"DisableScreenChangeEvents()");
  1.1194 +		aText.Append(LogWinDisableScreenChangeEvents);
  1.1195 +		}
  1.1196 +		break;
  1.1197 +	case EWsWinOpSendPointerEvent:
  1.1198 +		{
  1.1199 +		_LIT(LogWinSendPointerEvent,"SimulatePointerEvent(");
  1.1200 +		aText.Append(LogWinSendPointerEvent);
  1.1201 +		aText.Append(eventDetails(pData.RawEvent));
  1.1202 +		aText.Append(LogCloseBracket);
  1.1203 +		}
  1.1204 +		break;
  1.1205 +	case EWsWinOpSendAdvancedPointerEvent:
  1.1206 +		{
  1.1207 +		_LIT(LogWinSendPointerEvent,"SimulateAdvancedPointerEvent(");
  1.1208 +		aText.Append(LogWinSendPointerEvent);
  1.1209 +		aText.Append(eventDetails(pData.RawEvent));
  1.1210 +		aText.Append(LogCloseBracket);
  1.1211 +		}
  1.1212 +		break;
  1.1213 +	case EWsWinOpGetDisplayMode:
  1.1214 +		{
  1.1215 +		_LIT(LogWinGetDisplayMode,"GetDisplayMode()");
  1.1216 +		aText.Append(LogWinGetDisplayMode);
  1.1217 +		}
  1.1218 +		break;
  1.1219 +	case EWsWinOpGetIsFaded:
  1.1220 +		{
  1.1221 +		_LIT(LogWinIsFaded,"IsFaded()");
  1.1222 +		aText.Append(LogWinIsFaded);
  1.1223 +		}
  1.1224 +		break;
  1.1225 +	case EWsWinOpGetIsNonFading:
  1.1226 +		{
  1.1227 +		_LIT(LogWinIsNonFading,"IsNonFading()");
  1.1228 +		aText.Append(LogWinIsNonFading);
  1.1229 +		}
  1.1230 +		break;
  1.1231 +	case EWsWinOpOrdinalPriority:
  1.1232 +		{
  1.1233 +		_LIT(LogWinOrdinalPriority,"OrdinalPriority()");
  1.1234 +		aText.Append(LogWinOrdinalPriority);
  1.1235 +		}
  1.1236 +		break;
  1.1237 +	case EWsWinOpClearPointerCursor:
  1.1238 +		{
  1.1239 +		_LIT(LogWinClearPointerCursor,"ClearPointerCursor()");
  1.1240 +		aText.Append(LogWinClearPointerCursor);
  1.1241 +		}
  1.1242 +		break;
  1.1243 +	case EWsWinOpEnableGroupListChangeEvents:
  1.1244 +		{
  1.1245 +		_LIT(LogWinEnableGroupListChangeEvents,"EnableGroupListChangeEvents()");
  1.1246 +		aText.Append(LogWinEnableGroupListChangeEvents);
  1.1247 +		}
  1.1248 +		break;
  1.1249 +	case EWsWinOpDisableGroupListChangeEvents:
  1.1250 +		{
  1.1251 +		_LIT(LogWinDisableGroupListChangeEvents,"DisableGroupListChangeEvents()");
  1.1252 +		aText.Append(LogWinDisableGroupListChangeEvents);
  1.1253 +		}
  1.1254 +		break;
  1.1255 +	case EWsWinOpHandleTransparencyUpdate:
  1.1256 +		{
  1.1257 +		_LIT(LogWinHandleTransparencyUpdate,"HandleTransparencyUpdate()");
  1.1258 +		aText.Append(LogWinHandleTransparencyUpdate);
  1.1259 +		}
  1.1260 +		break;
  1.1261 +	case EWsWinOpSetTransparencyFactor:
  1.1262 +		{
  1.1263 +		_LIT(LogWinSetTransparencyFactor,"SetTransparencyFactor()");
  1.1264 +		aText.Append(LogWinSetTransparencyFactor);
  1.1265 +		}
  1.1266 +		break;
  1.1267 +	case EWsWinOpSetTransparencyBitmap:
  1.1268 +		{
  1.1269 +		_LIT(LogWinSetTransparencyBitmap,"SetTransparencyBitmap()");
  1.1270 +		aText.Append(LogWinSetTransparencyBitmap);
  1.1271 +		}
  1.1272 +		break;
  1.1273 +	case EWsWinOpSetTransparencyBitmapCWs:
  1.1274 +		{
  1.1275 +		_LIT(LogWinSetTransparencyWsBitmap,"SetTransparencyWsBitmap()");
  1.1276 +		aText.Append(LogWinSetTransparencyWsBitmap);
  1.1277 +		}
  1.1278 +		break;	
  1.1279 +
  1.1280 +	case EWsWinOpSetTransparencyAlphaChannel:
  1.1281 +		{
  1.1282 +		_LIT(LogWinSetTransparencyAlphaChannel,"SetTransparencyAlphaChannel()");
  1.1283 +		aText.Append(LogWinSetTransparencyAlphaChannel);
  1.1284 +		}
  1.1285 +		break;	
  1.1286 +	case EWsWinOpMoveToGroup:
  1.1287 +		{
  1.1288 +		_LIT(LogWinMoveToGroup,"MoveToGroup(%d)");
  1.1289 +		aText.AppendFormat(LogWinMoveToGroup, *pData.Int);
  1.1290 +		}
  1.1291 +		break;	
  1.1292 +	case EWsWinOpStoreDrawCommands:
  1.1293 +		{
  1.1294 +		_LIT(LogWinStoreDrawCommands,"EnableRedrawStore(%u)");
  1.1295 +		aText.AppendFormat(LogWinStoreDrawCommands, *pData.Bool);
  1.1296 +		}
  1.1297 +		break;	
  1.1298 +	case EWsWinOpSetPointerCapturePriority:
  1.1299 +		{
  1.1300 +		_LIT(LogWinSetPointerCapturePriority,"SetPointerCapturePriority(%d)");
  1.1301 +		aText.AppendFormat(LogWinSetPointerCapturePriority, *pData.Int);
  1.1302 +		}
  1.1303 +		break;	
  1.1304 +	case EWsWinOpGetPointerCapturePriority:
  1.1305 +		{
  1.1306 +		_LIT(LogWinGetPointerCapturePriority,"GetPointerCapturePriority()");
  1.1307 +		aText.Append(LogWinGetPointerCapturePriority);
  1.1308 +		}
  1.1309 +		break;	
  1.1310 +	case EWsWinOpSetTransparentRegion:
  1.1311 +		{
  1.1312 +		_LIT(LogWinSetTransparentRegion,"SetTransparentRegion(%d rects)");
  1.1313 +		aText.AppendFormat(LogWinSetTransparentRegion, pData.SetShape->count);
  1.1314 +		}
  1.1315 +		break;	
  1.1316 +	case EWsWinOpSetTransparencyPolicy:
  1.1317 +		{
  1.1318 +		_LIT(LogWinSetTransparentPolicy,"SetTransparencyPolicy(TransparencyPolicy= %d)");
  1.1319 +		aText.AppendFormat(LogWinSetTransparentPolicy, *pData.Int);
  1.1320 +		}
  1.1321 +		break;	
  1.1322 +	case EWsWinOpIsRedrawStoreEnabled:
  1.1323 +		{
  1.1324 +		_LIT(LogWinIsRedrawStoreEnabled,"IsRedrawStoreEnabled()");
  1.1325 +		aText.Append(LogWinIsRedrawStoreEnabled);
  1.1326 +		}
  1.1327 +		break;		
  1.1328 +	case EWsWinOpEnableOSB:
  1.1329 +		{
  1.1330 +		_LIT(LogOSBEnabled,"EWsWinOpEnableOSB enum");
  1.1331 +		aText.Append(LogOSBEnabled);
  1.1332 +		}
  1.1333 +		break;		
  1.1334 +	case EWsWinOpDisableOSB:
  1.1335 +		{
  1.1336 +		_LIT(LogOSBDisabled,"EWsWinOpDisableOSB enum");
  1.1337 +		aText.Append(LogOSBDisabled);
  1.1338 +		}
  1.1339 +		break;
  1.1340 +	case EWsWinOpClientHandle:
  1.1341 +		{
  1.1342 +		_LIT(LogClientHandle,"ClientHandle()");
  1.1343 +		aText.AppendFormat(LogClientHandle);
  1.1344 +		}
  1.1345 +		break;
  1.1346 +    case EWsWinOpSetBackgroundSurface:
  1.1347 +        {
  1.1348 +        _LIT(LogWinSetBackgroundSurface,"SetBackgroundSurface(TSurfaceId{%x,%x,%x,%x})");
  1.1349 +        aText.AppendFormat(LogWinSetBackgroundSurface, pData.Surface->iInternal[0],pData.Surface->iInternal[1],pData.Surface->iInternal[2],pData.Surface->iInternal[3]);
  1.1350 +        }
  1.1351 +        break;
  1.1352 +    case EWsWinOpKeyColor:
  1.1353 +        {
  1.1354 +        _LIT(LogWinKeyColor,"KeyColor()");
  1.1355 +        aText.AppendFormat(LogWinKeyColor);
  1.1356 +        }
  1.1357 +        break;          
  1.1358 +    case EWsWinOpSetBackgroundSurfaceConfig:
  1.1359 +        {        
  1.1360 +        TSurfaceConfiguration aSurfaceConfig = pData.SurfaceConfigurationAndTrigger->surfaceConfig;
  1.1361 +        TSurfaceId surfaceid;
  1.1362 +        aSurfaceConfig.GetSurfaceId(surfaceid);
  1.1363 +        CFbsBitGc::TGraphicsOrientation orientation = aSurfaceConfig.Orientation();
  1.1364 +        TRect extent;
  1.1365 +        aSurfaceConfig.GetExtent(extent);
  1.1366 +        TRect viewport;
  1.1367 +        aSurfaceConfig.GetViewport(viewport);
  1.1368 +        TBool flip = aSurfaceConfig.Flip();
  1.1369 +        TBool triggerRedraw = pData.SurfaceConfigurationAndTrigger->triggerRedraw;
  1.1370 +        
  1.1371 +        TLongBuf extentbuf(TDebugLogTextHandler::FormatRect(extent));
  1.1372 +        TLongBuf viewportbuf(TDebugLogTextHandler::FormatRect(viewport));
  1.1373 +        
  1.1374 +        _LIT(LogWinSetBackgroundSurfaceConfig,"SetBackgroundSurface({%x,%x,%x,%x},%d,%S,%S,%d,%d)");
  1.1375 +        aText.AppendFormat(LogWinSetBackgroundSurfaceConfig, surfaceid.iInternal[0],
  1.1376 +                                                             surfaceid.iInternal[1],
  1.1377 +                                                             surfaceid.iInternal[2],
  1.1378 +                                                             surfaceid.iInternal[3],
  1.1379 +                                                             orientation,
  1.1380 +                                                             &extentbuf, 
  1.1381 +                                                             &viewportbuf,
  1.1382 +                                                             flip,
  1.1383 +                                                             triggerRedraw);
  1.1384 +        }
  1.1385 +        break;
  1.1386 +    case EWsWinOpRemoveBackgroundSurface:
  1.1387 +        {
  1.1388 +        _LIT(LogWinRemoveBackgroundSurface,"RemoveBackgroundSurface(%d)");
  1.1389 +        aText.AppendFormat(LogWinRemoveBackgroundSurface, *(pData.Bool));
  1.1390 +        }
  1.1391 +        break;
  1.1392 +    case EWsWinOpGetBackgroundSurfaceConfig:
  1.1393 +        {
  1.1394 +        _LIT(LogWinGetBackgroundSurfaceConfig,"GetBackgroundSurface()");
  1.1395 +        aText.AppendFormat(LogWinGetBackgroundSurfaceConfig);
  1.1396 +        }
  1.1397 +        break;
  1.1398 +    case EWsWinOpClearRedrawStore:
  1.1399 +        {
  1.1400 +        _LIT(LogWinClearRedrawStore,"ClearRedrawStore()");
  1.1401 +        aText.AppendFormat(LogWinClearRedrawStore);
  1.1402 +        }
  1.1403 +        break;
  1.1404 +	default:
  1.1405 +		UnKnownOpcode(aText, aOpcode);
  1.1406 +		break;
  1.1407 +		}
  1.1408 +	}
  1.1409 +
  1.1410 +//#pragma check_stack(on)
  1.1411 +void TWsDecoder::DecodeGc(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.1412 +	{
  1.1413 +	_LIT(LogGc,"RGc[%d]::");
  1.1414 +	aText.Format(LogGc,aHandle);
  1.1415 +    if (aOpcode<EWsGcOpGdiBlt2)
  1.1416 +        {
  1.1417 +        if (aOpcode<EWsGcOpDrawPolyLineContinued)
  1.1418 +            DecodeGc1(aText,aOpcode,aCmdData);
  1.1419 +        else
  1.1420 +            DecodeGc2(aText,aOpcode,aCmdData);
  1.1421 +        }
  1.1422 +    else
  1.1423 +        DecodeGc3(aText,aOpcode,aCmdData);
  1.1424 +    }
  1.1425 +    
  1.1426 +void TWsDecoder::DecodeGc1(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
  1.1427 +	{
  1.1428 +	TWsGcCmdUnion pData;
  1.1429 +
  1.1430 +	pData.any=aCmdData;
  1.1431 +	switch (aOpcode)
  1.1432 +		{
  1.1433 +	case EWsGcOpFree:
  1.1434 +		aText.AppendFormat(LogClose);
  1.1435 +		break;
  1.1436 +	case EWsGcOpActivate:
  1.1437 +		{
  1.1438 +		_LIT(LogGcActivate,"Activate(%d)");
  1.1439 +		aText.AppendFormat(LogGcActivate,hHandleToValue(*pData.UInt));
  1.1440 +		}
  1.1441 +		break;
  1.1442 +	case EWsGcOpDeactivate:
  1.1443 +		{
  1.1444 +		_LIT(LogGcDeactivate,"Deactivate()");
  1.1445 +		aText.AppendFormat(LogGcDeactivate);
  1.1446 +		}
  1.1447 +		break;
  1.1448 +	case EWsGcOpDrawLine:
  1.1449 +		{
  1.1450 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt1));
  1.1451 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt2));
  1.1452 +		_LIT(LogGcDrawLine,"DrawLine(%S, %S)");
  1.1453 +		aText.AppendFormat(LogGcDrawLine, &buf1, &buf2);
  1.1454 +		}
  1.1455 +		break;
  1.1456 +	case EWsGcOpSetBrushStyle:
  1.1457 +		{
  1.1458 +		_LIT(LogGcSetBrushStyle,"SetBrushStyle(%u)");
  1.1459 +		aText.AppendFormat(LogGcSetBrushStyle,*pData.UInt);
  1.1460 +		}
  1.1461 +		break;
  1.1462 +	case EWsGcOpPlot:
  1.1463 +		{
  1.1464 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1465 +		_LIT(LogGcPlot,"Plot(%S)");
  1.1466 +		aText.AppendFormat(LogGcPlot, &buf);
  1.1467 +		}
  1.1468 +		break;
  1.1469 +	case EWsGcOpSetPenColor:
  1.1470 +		{
  1.1471 +		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
  1.1472 +		_LIT(LogGcSetPenColor,"SetPenColor(%S)");
  1.1473 +		aText.AppendFormat(LogGcSetPenColor,&buf);
  1.1474 +		}
  1.1475 +		break;
  1.1476 +	case EWsGcOpSetBrushColor:
  1.1477 +		{
  1.1478 +		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
  1.1479 +		_LIT(LogGcSetBrushColor,"SetBrushColor(%S)");
  1.1480 +		aText.AppendFormat(LogGcSetBrushColor,&buf);
  1.1481 +		}
  1.1482 +		break;
  1.1483 +	case EWsGcOpSetPenSize:
  1.1484 +		{
  1.1485 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1486 +		_LIT(LogGcSetPenSize,"SetPenSize(%S)");
  1.1487 +		aText.AppendFormat(LogGcSetPenSize,&buf);
  1.1488 +		}
  1.1489 +		break;
  1.1490 +	case EWsGcOpSetPenStyle:
  1.1491 +		{
  1.1492 +		_LIT(LogGcSetPenStyle,"SetPenStyle(%d)");
  1.1493 +		aText.AppendFormat(LogGcSetPenStyle,*pData.UInt);
  1.1494 +		}
  1.1495 +		break;
  1.1496 +	case EWsGcOpSetClippingRegion:
  1.1497 +		{
  1.1498 +		_LIT(LogGcSetClippingRegion,"SetClippingRegion(...)");
  1.1499 +		aText.Append(LogGcSetClippingRegion);
  1.1500 +		}
  1.1501 +		break;
  1.1502 +	case EWsGcOpCancelClippingRegion:
  1.1503 +		{
  1.1504 +		_LIT(LogGcCancelClippingRegion,"CancelClippingRegion()");
  1.1505 +		aText.Append(LogGcCancelClippingRegion);
  1.1506 +		}
  1.1507 +		break;
  1.1508 +	case EWsGcOpSetClippingRect:
  1.1509 +		{
  1.1510 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
  1.1511 +		_LIT(LogGcSetClippingRect,"SetClippingRect(%S)");
  1.1512 +		aText.AppendFormat(LogGcSetClippingRect,&buf);
  1.1513 +		}
  1.1514 +		break;
  1.1515 +	case EWsGcOpCancelClippingRect:
  1.1516 +		{
  1.1517 +		_LIT(LogGcCancelClippingRect,"CancelClippingRect()");
  1.1518 +		aText.Append(LogGcCancelClippingRect);
  1.1519 +		}
  1.1520 +		break;
  1.1521 +	case EWsGcOpDrawTo:
  1.1522 +		{
  1.1523 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1524 +		_LIT(LogGcDrawTo,"DrawTo(%S)");
  1.1525 +		aText.AppendFormat(LogGcDrawTo,&buf);
  1.1526 +		}
  1.1527 +		break;
  1.1528 +	case EWsGcOpDrawBy:
  1.1529 +		{
  1.1530 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1531 +		_LIT(LogGcDrawBy,"DrawBy(%S)");
  1.1532 +		aText.AppendFormat(LogGcDrawBy,&buf);
  1.1533 +		}
  1.1534 +		break;
  1.1535 +	case EWsGcOpDrawPolyLine:
  1.1536 +		{
  1.1537 +		_LIT(LogGcDrawPolyLine,"DrawPolyLine(%d...)");
  1.1538 +		aText.AppendFormat(LogGcDrawPolyLine,pData.PolyLine->numPoints);
  1.1539 +		}
  1.1540 +		break;
  1.1541 +	case EWsGcOpDrawPolyLineContinued:
  1.1542 +		{
  1.1543 +		_LIT(LogGcDrawPolyLineContinued,"DrawPolyLineContinued(%d...)");
  1.1544 +		aText.AppendFormat(LogGcDrawPolyLineContinued,pData.PolyLine->numPoints);
  1.1545 +		}
  1.1546 +		break;
  1.1547 +	case EWsGcOpUseBrushPattern:
  1.1548 +		{
  1.1549 +		_LIT(LogGcUseBrushPattern,"UseBrushPattern({0x%x})");
  1.1550 +		aText.AppendFormat(LogGcUseBrushPattern,hHandleToValue(*pData.handle));
  1.1551 +		}
  1.1552 +		break;
  1.1553 +	case EWsGcOpDrawArc:
  1.1554 +		{
  1.1555 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect));
  1.1556 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start));
  1.1557 +		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end));
  1.1558 +		_LIT(LogGcDrawArc,"DrawArc(%S,%S,%S)");
  1.1559 +		aText.AppendFormat(LogGcDrawArc,&buf1,&buf2,&buf3);
  1.1560 +		}
  1.1561 +		break;
  1.1562 +	case EWsGcOpSetWordJustification:
  1.1563 +		{
  1.1564 +		_LIT(LogGcSetWordJustification,"SetWordJustification(%d,%d)");
  1.1565 +		aText.AppendFormat(LogGcSetWordJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps);
  1.1566 +		}
  1.1567 +		break;
  1.1568 +	case EWsGcOpSetCharJustification:
  1.1569 +		{
  1.1570 +		_LIT(LogGcSetCharJustification,"SetCharJustification(%d,%d)");
  1.1571 +		aText.AppendFormat(LogGcSetCharJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps);
  1.1572 +		}
  1.1573 +		break;
  1.1574 +	case EWsGcOpSetBrushOrigin:
  1.1575 +		{
  1.1576 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1577 +		aText.AppendFormat(_L("SetBrushOrigin(%S)"), &buf);		
  1.1578 +		}
  1.1579 +		break;
  1.1580 +	case EWsGcOpDiscardBrushPattern:
  1.1581 +		{
  1.1582 +		_LIT(LogGcDiscardBrushPattern,"DiscardBrushPattern()");
  1.1583 +		aText.Append(LogGcDiscardBrushPattern);
  1.1584 +		}	
  1.1585 +		break;	
  1.1586 + 	default:
  1.1587 +		UnKnownOpcode(aText, aOpcode);
  1.1588 +		break;
  1.1589 +		}
  1.1590 +	}
  1.1591 +
  1.1592 +void TWsDecoder::DecodeGc2(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
  1.1593 +	{
  1.1594 +	TWsGcCmdUnion pData;
  1.1595 +
  1.1596 +	pData.any=aCmdData;
  1.1597 +	switch (aOpcode)
  1.1598 +		{
  1.1599 +	case EWsGcOpDrawText:
  1.1600 +		{
  1.1601 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos));
  1.1602 +		_LIT(LogGcDrawText1,"DrawText(\"");
  1.1603 +		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
  1.1604 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawText+1), pData.DrawText->length));
  1.1605 +		_LIT(LogGcDrawText2,"\", %S)");
  1.1606 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf);
  1.1607 +		}
  1.1608 +		break;
  1.1609 +	case EWsGcOpDrawTextVertical:
  1.1610 +		{
  1.1611 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos));
  1.1612 +		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(\"");
  1.1613 +		TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1);
  1.1614 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawTextVertical+1), pData.DrawTextVertical->length));
  1.1615 +		_LIT(LogGcDrawTextVertical2,"\", %S, %d)");
  1.1616 +		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up);
  1.1617 +		}
  1.1618 +		break;
  1.1619 +	case EWsGcOpDrawTextVerticalPtr:
  1.1620 +		{
  1.1621 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos));
  1.1622 +		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(...");
  1.1623 +		TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1);
  1.1624 +		_LIT(LogGcDrawTextVertical2,", %S, %d)");
  1.1625 +		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up);
  1.1626 +		}
  1.1627 +		break;
  1.1628 +	case EWsGcOpDrawTextPtr:
  1.1629 +		{
  1.1630 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos));
  1.1631 +		_LIT(LogGcDrawText1,"DrawText(...");
  1.1632 +		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
  1.1633 +		_LIT(LogGcDrawText2,",%S)");
  1.1634 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf);
  1.1635 +		}
  1.1636 +		break;
  1.1637 +	case EWsGcOpDrawBoxTextOptimised1:
  1.1638 +		{
  1.1639 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO1->box));
  1.1640 +		_LIT(LogGcDrawText1,"DrawText(\"");
  1.1641 +		aText.Append(LogGcDrawText1);
  1.1642 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO1+1), pData.BoxTextO1->length));
  1.1643 +		_LIT(LogGcDrawText2,"\", %S, %d, %d, 0)");
  1.1644 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf,
  1.1645 +										pData.BoxTextO1->baselineOffset,CGraphicsContext::ELeft);
  1.1646 +		}
  1.1647 +		break;
  1.1648 +	case EWsGcOpDrawBoxTextOptimised2:
  1.1649 +		{
  1.1650 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO2->box));
  1.1651 +		_LIT(LogGcDrawText1,"DrawText(\"");
  1.1652 +		aText.Append(LogGcDrawText1);
  1.1653 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO2+1), pData.BoxTextO2->length));
  1.1654 +		_LIT(LogGcDrawText2,"\", %S, %d, %d, %d)");
  1.1655 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxTextO2->baselineOffset, 
  1.1656 +										pData.BoxTextO2->horiz, pData.BoxTextO2->leftMrg);
  1.1657 +		}
  1.1658 +		break;
  1.1659 +	case EWsGcOpDrawBoxTextVertical:
  1.1660 +		{
  1.1661 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box));
  1.1662 +		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(\"");
  1.1663 +		aText.Append(LogGcDrawTextVertical1);
  1.1664 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawBoxTextVertical+1), pData.DrawBoxTextVertical->length));
  1.1665 +		_LIT(LogGcDrawTextVertical2,"\", %S, %d, %d, %d, %d)");
  1.1666 +		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler, &buf,
  1.1667 +										pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up,
  1.1668 +										pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin);
  1.1669 +		}
  1.1670 +		break;
  1.1671 +	case EWsGcOpDrawBoxTextPtr:
  1.1672 +		{
  1.1673 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box));
  1.1674 +		_LIT(LogGcDrawText1,"DrawText(...");
  1.1675 +		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
  1.1676 +		_LIT(LogGcDrawText2,", %S, %d, %d, %d)");
  1.1677 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset,
  1.1678 +										pData.BoxText->horiz, pData.BoxText->leftMrg);
  1.1679 +		}
  1.1680 +		break;
  1.1681 +	case EWsGcOpDrawBoxTextVerticalPtr:
  1.1682 +		{
  1.1683 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box));
  1.1684 +		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(...");
  1.1685 +		aText.Append(LogGcDrawTextVertical1);
  1.1686 +		_LIT(LogGcDrawTextVertical2,", %S, %d, %d, %d, %d)");
  1.1687 +		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,
  1.1688 +										pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up,
  1.1689 +										pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin);
  1.1690 +		}
  1.1691 +		break;
  1.1692 +	case EWsGcOpCopyRect:
  1.1693 +		{
  1.1694 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.CopyRect->pos));
  1.1695 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.CopyRect->rect));
  1.1696 +		_LIT(LogGcCopyRect,"CopyRect(%S, %S)");
  1.1697 +		aText.AppendFormat(LogGcCopyRect,&buf1,&buf2);
  1.1698 +		}
  1.1699 +		break;
  1.1700 +	case EWsGcOpDrawEllipse:
  1.1701 +		{
  1.1702 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
  1.1703 +		_LIT(LogGcDrawEllipse,"DrawEllipse(%S)");
  1.1704 +		aText.AppendFormat(LogGcDrawEllipse,&buf);
  1.1705 +		}
  1.1706 +		break;
  1.1707 +	case EWsGcOpMoveTo:
  1.1708 +		{
  1.1709 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1710 +		_LIT(LogGcMoveTo,"MoveTo(%S)");
  1.1711 +		aText.AppendFormat(LogGcMoveTo,&buf);
  1.1712 +		}
  1.1713 +		break;
  1.1714 +	case EWsGcOpMoveBy:
  1.1715 +		{
  1.1716 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1717 +		_LIT(LogGcMoveBy,"MoveBy(%S)");
  1.1718 +		aText.AppendFormat(LogGcMoveBy,&buf);
  1.1719 +		}
  1.1720 +		break;
  1.1721 +	case EWsGcOpDrawPolygon:
  1.1722 +		{
  1.1723 +		_LIT(LogGcDrawPolygon,"DrawPolygon(...)");
  1.1724 +		aText.Append(LogGcDrawPolygon);
  1.1725 +		}
  1.1726 +		break;
  1.1727 +	case EWsGcOpDrawRoundRect:
  1.1728 +		{
  1.1729 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RoundRect->rect));
  1.1730 +		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.RoundRect->ellipse));
  1.1731 +		_LIT(LogGcDrawRoundRect,"DrawRoundRect(%S,%S)");
  1.1732 +		aText.AppendFormat(LogGcDrawRoundRect,&buf1,&buf2);
  1.1733 +		}
  1.1734 +		break;
  1.1735 +	case EWsGcOpDrawPie:
  1.1736 +		{
  1.1737 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect));
  1.1738 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start));
  1.1739 +		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end));
  1.1740 +		_LIT(LogGcDrawPie,"DrawPie(%S,%S,%S)");
  1.1741 +		aText.AppendFormat(LogGcDrawPie,&buf1,&buf2,&buf3);
  1.1742 +		}
  1.1743 +		break;
  1.1744 +	case EWsGcOpSetOrigin:
  1.1745 +		{
  1.1746 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1747 +		_LIT(LogGcSetOrigin,"SetOrigin(%S)");
  1.1748 +		aText.AppendFormat(LogGcSetOrigin,&buf);
  1.1749 +		}
  1.1750 +		break;
  1.1751 +	case EWsGcOpStartSegmentedDrawPolygon:
  1.1752 +		{
  1.1753 +		_LIT(LogGcStartSegmentedDrawPolygon,"StartSegmentedDrawPolygon(%d)");
  1.1754 +		aText.AppendFormat(LogGcStartSegmentedDrawPolygon,*pData.StartSegmentedDrawPolygon);
  1.1755 +		}
  1.1756 +		break;
  1.1757 +	case EWsGcOpSegmentedDrawPolygonData:
  1.1758 +		{
  1.1759 +		_LIT(LogGcSegmentedDrawPolygonData,"SegmentedDrawPolygonData(%d,%d,...)");
  1.1760 +		aText.AppendFormat(LogGcSegmentedDrawPolygonData,pData.SegmentedDrawPolygonData->index,
  1.1761 +									pData.SegmentedDrawPolygonData->numPoints);
  1.1762 +		}
  1.1763 +		break;
  1.1764 +	case EWsGcOpDrawSegmentedPolygon:
  1.1765 +		{
  1.1766 +		_LIT(LogGcDrawSegmentedPolygon,"DrawSegmentedPolygon()");
  1.1767 +		aText.AppendFormat(LogGcDrawSegmentedPolygon);
  1.1768 +		}
  1.1769 +		break;
  1.1770 +	case EWsGcOpDrawRect:
  1.1771 +		{
  1.1772 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
  1.1773 +		_LIT(LogGcDrawRect,"DrawRect(%S)");
  1.1774 +		aText.AppendFormat(LogGcDrawRect,&buf);
  1.1775 +		}
  1.1776 +		break;
  1.1777 +	case EWsGcOpDrawBitmap:
  1.1778 +		{
  1.1779 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.Bitmap->pos));
  1.1780 +		_LIT(KLitGcDrawBitmap, "DrawBitmap({%d}, %S)");
  1.1781 +		aText.AppendFormat(KLitGcDrawBitmap, hHandleToValue(pData.Bitmap->handle), &buf);
  1.1782 +		}
  1.1783 +		break;
  1.1784 +	case EWsGcOpDrawBitmap2:
  1.1785 +		{
  1.1786 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.Bitmap2->rect));
  1.1787 +		_LIT(KLitGcDrawBitmap2, "DrawBitmap2({%d}, %S)");
  1.1788 +		aText.AppendFormat(KLitGcDrawBitmap2, hHandleToValue(pData.Bitmap2->handle), &buf);
  1.1789 +		}
  1.1790 +		break;
  1.1791 +	case EWsGcOpDrawBitmap3:
  1.1792 +		{
  1.1793 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.Bitmap3->rect));
  1.1794 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.Bitmap3->srcRect));
  1.1795 +		_LIT(KLitGcDrawBitmap3, "DrawBitmap3({%d}, %S, %S)");
  1.1796 +		aText.AppendFormat(KLitGcDrawBitmap3, hHandleToValue(pData.Bitmap3->handle), &buf1, &buf2);
  1.1797 +		}
  1.1798 +		break;
  1.1799 +	case EWsGcOpDrawBitmapMasked:
  1.1800 +	case EWsGcOpWsDrawBitmapMasked:
  1.1801 +		{
  1.1802 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iRect));
  1.1803 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iSrcRect));
  1.1804 +		_LIT(KLitGcDrawBitmapMasked, "DrawBitmapMasked(%S, {%d}, %S, {%d}, %d)");
  1.1805 +		aText.AppendFormat(KLitGcDrawBitmapMasked, &buf1, hHandleToValue(pData.iBitmapMasked->iHandle), 
  1.1806 +			&buf2, hHandleToValue(pData.iBitmapMasked->iMaskHandle), pData.iBitmapMasked->iInvertMask);
  1.1807 +		}
  1.1808 +		break;
  1.1809 +	case EWsGcOpDrawBoxText:
  1.1810 +		{
  1.1811 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box));
  1.1812 +		_LIT(LogGcDrawText1,"DrawText(\"");
  1.1813 +		aText.Append(LogGcDrawText1);
  1.1814 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxText+1), pData.BoxText->length));
  1.1815 +		_LIT(LogGcDrawText2,"\", %S, %d, %d, %d)");
  1.1816 +		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset, 
  1.1817 +										pData.BoxText->horiz, pData.BoxText->leftMrg);
  1.1818 +		}
  1.1819 +		break;		
  1.1820 +	default:
  1.1821 +		UnKnownOpcode(aText, aOpcode);
  1.1822 +		break;
  1.1823 +		}
  1.1824 +	}
  1.1825 +
  1.1826 +void TWsDecoder::DecodeGc3(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
  1.1827 +	{
  1.1828 +	TWsGcCmdUnion pData;
  1.1829 +
  1.1830 +	pData.any=aCmdData;
  1.1831 +	switch (aOpcode)
  1.1832 +		{
  1.1833 +	case EWsGcOpSetDrawMode:
  1.1834 +		{
  1.1835 +		_LIT(LogGcSetDrawMode,"SetDrawMode(%u)");
  1.1836 +		aText.AppendFormat(LogGcSetDrawMode,*pData.UInt);
  1.1837 +		}
  1.1838 +		break;
  1.1839 +	case EWsGcOpClearRect:
  1.1840 +		{
  1.1841 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
  1.1842 +		_LIT(LogGcClear,"Clear(%S)");
  1.1843 +		aText.AppendFormat(LogGcClear, &buf);
  1.1844 +		}
  1.1845 +		break;
  1.1846 +	case EWsGcOpClear:
  1.1847 +		{
  1.1848 +		_LIT(LogGcClear,"Clear()");
  1.1849 +		aText.AppendFormat(LogGcClear);
  1.1850 +		}
  1.1851 +		break;
  1.1852 +	case EWsGcOpGdiBlt2:
  1.1853 +	case EWsGcOpGdiWsBlt2:
  1.1854 +		{
  1.1855 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GdiBlt2->pos));
  1.1856 +		_LIT(LogGcGdiBlt,"GdiBlt(%S, {%d})");
  1.1857 +		aText.AppendFormat(LogGcGdiBlt,&buf,hHandleToValue(pData.GdiBlt2->handle));
  1.1858 +		}
  1.1859 +		break;
  1.1860 +	case EWsGcOpGdiBlt3:
  1.1861 +	case EWsGcOpGdiWsBlt3:
  1.1862 +		{
  1.1863 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBlt3->pos));
  1.1864 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBlt3->rect));
  1.1865 +		_LIT(LogGcGdiBlt,"GdiBlt(%S, {%d}, %S)");
  1.1866 +		aText.AppendFormat(LogGcGdiBlt,&buf1,hHandleToValue(pData.GdiBlt3->handle),&buf2);
  1.1867 +		}
  1.1868 +		break;
  1.1869 +	case EWsGcOpGdiBltMasked:
  1.1870 +	case EWsGcOpGdiWsBltMasked:
  1.1871 +		{
  1.1872 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBltMasked->destination));
  1.1873 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBltMasked->source));
  1.1874 +		_LIT(LogGcBitBltMasked,"BitBltMasked(%S, {%d}, %S, {%d}, %d)");
  1.1875 +		aText.AppendFormat(LogGcBitBltMasked, &buf1, hHandleToValue(pData.GdiBltMasked->handle),
  1.1876 +										&buf2, hHandleToValue(pData.GdiBltMasked->maskHandle),
  1.1877 +										pData.GdiBltMasked->invertMask);
  1.1878 +		}
  1.1879 +		break;
  1.1880 +	case EWsGcOpSize:
  1.1881 +		{
  1.1882 +		_LIT(LogGcSize,"Size()");
  1.1883 +		aText.AppendFormat(LogGcSize);
  1.1884 +		}
  1.1885 +		break;
  1.1886 +	case EWsGcOpUseFont:
  1.1887 +		{
  1.1888 +		_LIT(LogGcUseFont,"UseFont({0x%x})");
  1.1889 +		aText.AppendFormat(LogGcUseFont,hHandleToValue(*pData.handle));
  1.1890 +		}
  1.1891 +		break;
  1.1892 +	case EWsGcOpDiscardFont:
  1.1893 +		{
  1.1894 +		_LIT(LogGcDiscardFont,"DiscardFont()");
  1.1895 +		aText.AppendFormat(LogGcDiscardFont);
  1.1896 +		}
  1.1897 +		break;
  1.1898 +	case EWsGcOpTestInvariant:
  1.1899 +		{
  1.1900 +		_LIT(LogGcTestInvariant,"unimplemented opcode 'EWsGcOpTestInvariant' (%u)");
  1.1901 +		aText.AppendFormat(LogGcTestInvariant, aOpcode);
  1.1902 +		}
  1.1903 +		break;
  1.1904 +	case EWsGcOpReset:
  1.1905 +		{
  1.1906 +		_LIT(LogGcReset,"Reset()");
  1.1907 +		aText.Append(LogGcReset);
  1.1908 +		}
  1.1909 +		break;
  1.1910 +	case EWsGcOpSetDitherOrigin:
  1.1911 +		{
  1.1912 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.1913 +		_LIT(LogGcSetDitherOrigin,"SetDitherOrigin(%S)");
  1.1914 +		aText.AppendFormat(LogGcSetDitherOrigin,&buf);
  1.1915 +		}
  1.1916 +		break;
  1.1917 +	case EWsGcOpMapColors:
  1.1918 +		{
  1.1919 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.MapColors->rect));
  1.1920 +		_LIT(LogGcMapColors,"MapColors(%S,?,%d)");
  1.1921 +		aText.AppendFormat(LogGcMapColors,&buf,pData.MapColors->numPairs);
  1.1922 +		}
  1.1923 +		break;
  1.1924 +	case EWsGcOpSetUnderlineStyle:
  1.1925 +		{
  1.1926 +		_LIT(LogGcSetUnderlineStyle,"SetUnderlineStyle(%x)");
  1.1927 +		aText.AppendFormat(LogGcSetUnderlineStyle,*pData.SetUnderlineStyle);
  1.1928 +		}
  1.1929 +		break;
  1.1930 +	case EWsGcOpSetStrikethroughStyle:
  1.1931 +		{
  1.1932 +		_LIT(LogGcSetStrikethroughStyle,"SetStrikethroughStyle(%x)");
  1.1933 +		aText.AppendFormat(LogGcSetStrikethroughStyle,*pData.SetStrikethroughStyle);
  1.1934 +		}
  1.1935 +		break;
  1.1936 +	case EWsGcOpDrawWsGraphic:
  1.1937 +	case EWsGcOpDrawWsGraphicPtr:
  1.1938 +		{
  1.1939 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.WsGraphic->iRect));
  1.1940 +		_LIT(KLitGcDrawWsGraphic,"DrawWsGraphic(%x, %d, %S, %d)");
  1.1941 +		aText.AppendFormat(KLitGcDrawWsGraphic, pData.WsGraphic->iFlags, pData.WsGraphic->iId, &buf, pData.WsGraphic->iDataLen);
  1.1942 +		}
  1.1943 +		break;
  1.1944 +	case EWsGcOpSetFaded:
  1.1945 +		{
  1.1946 +		_LIT(KLitGcSetFaded, "SetFaded(%d)");
  1.1947 +		aText.AppendFormat(KLitGcSetFaded, *pData.Bool);
  1.1948 +		}
  1.1949 +		break;
  1.1950 +	case EWsGcOpSetFadeParams:
  1.1951 +		{
  1.1952 +		_LIT(KLitGcSetFadeParams, "SetFadeParams(BlackMap %d, WhiteMap %d)");
  1.1953 +		const unsigned char *bytePtr = (const unsigned char*)(pData.UInt);
  1.1954 +		aText.AppendFormat(KLitGcSetFadeParams, bytePtr[0], bytePtr[1]);
  1.1955 +		}
  1.1956 +		break;
  1.1957 +	case EWsGcOpGdiAlphaBlendBitmaps:
  1.1958 +	case EWsGcOpGdiWsAlphaBlendBitmaps:
  1.1959 +		{
  1.1960 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->point));
  1.1961 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.AlphaBlendBitmaps->source));
  1.1962 +		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->alphaPoint));
  1.1963 +		_LIT(KLitGcAlphaBlendBitmaps,"AlphaBlendBitmaps(%S, {%d}, %S, {%d}, %S)");
  1.1964 +		aText.AppendFormat(KLitGcAlphaBlendBitmaps, &buf1, hHandleToValue(pData.AlphaBlendBitmaps->bitmapHandle),
  1.1965 +										&buf2, hHandleToValue(pData.AlphaBlendBitmaps->alphaHandle),
  1.1966 +										&buf3);
  1.1967 +		}
  1.1968 +		break;
  1.1969 +	case EWsGcOpSetOpaque:
  1.1970 +		{
  1.1971 +		_LIT(KLitGcOpSetOpaque, "SetOpaque(%d)");
  1.1972 +		aText.AppendFormat(KLitGcOpSetOpaque, *pData.Bool);
  1.1973 +		}
  1.1974 +		break;
  1.1975 +	default:
  1.1976 +		UnKnownOpcode(aText, aOpcode);
  1.1977 +		break;
  1.1978 +		}
  1.1979 +	}
  1.1980 +
  1.1981 +void TWsDecoder::DecodeScreenDevice(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.1982 +	{
  1.1983 +	TWsSdCmdUnion pData;
  1.1984 +	_LIT(LogScreenDevice,"CWsScreenDevice[%d]::");
  1.1985 +
  1.1986 +	aText.Format(LogScreenDevice,aHandle);
  1.1987 +	pData.any=aCmdData;
  1.1988 +	switch (aOpcode)
  1.1989 +		{
  1.1990 +	case EWsSdOpFree:
  1.1991 +		{
  1.1992 +		_LIT(LogScreenDeviceDelete,"~CWsScreenDevice()");
  1.1993 +		aText.Append(LogScreenDeviceDelete);
  1.1994 +		}
  1.1995 +		break;
  1.1996 +	case EWsSdOpPixel:
  1.1997 +		{
  1.1998 +		_LIT(LogScreenDevicePixel,"Pixel(%S)");
  1.1999 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
  1.2000 +		aText.AppendFormat(LogScreenDevicePixel,&buf);
  1.2001 +		}
  1.2002 +		break;
  1.2003 +	case EWsSdOpGetScanLine:
  1.2004 +		{		//This fills up the log two much for test code
  1.2005 +		aText=KNullDesC;
  1.2006 +		/*_LIT(LogScreenDeviceGetScanLine,"GetScanLine(TRgb *aScanLine, %d, %S)");
  1.2007 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GetScanLine->pos));
  1.2008 +		aText.AppendFormat(LogScreenDeviceGetScanLine,pData.GetScanLine->len,&buf);*/
  1.2009 +		}
  1.2010 +		break;
  1.2011 +	case EWsSdOpHorizontalTwipsToPixels:
  1.2012 +		{
  1.2013 +		_LIT(LogScreenDeviceHorizontalTwipsToPixels,"HorizontalTwipsToPixels()");
  1.2014 +		aText.Append(LogScreenDeviceHorizontalTwipsToPixels);
  1.2015 +		}
  1.2016 +		break;
  1.2017 +	case EWsSdOpVerticalTwipsToPixels:
  1.2018 +		{
  1.2019 +		_LIT(LogScreenDeviceVerticalTwipsToPixels,"VerticalTwipsToPixels()");
  1.2020 +		aText.Append(LogScreenDeviceVerticalTwipsToPixels);
  1.2021 +		}
  1.2022 +		break;
  1.2023 +	case EWsSdOpHorizontalPixelsToTwips:
  1.2024 +		{
  1.2025 +		_LIT(LogScreenDeviceHorizontalPixelsToTwips,"HorizontalPixelsToTwips()");
  1.2026 +		aText.Append(LogScreenDeviceHorizontalPixelsToTwips);
  1.2027 +		}
  1.2028 +		break;
  1.2029 +	case EWsSdOpVerticalPixelsToTwips:
  1.2030 +		{
  1.2031 +		_LIT(LogScreenDeviceVerticalPixelsToTwips,"VerticalPixelsToTwips()");
  1.2032 +		aText.Append(LogScreenDeviceVerticalPixelsToTwips);
  1.2033 +		}
  1.2034 +		break;
  1.2035 +	case EWsSdOpPixelSize:
  1.2036 +		{
  1.2037 +		_LIT(LogScreenDeviceSizeInPixels,"SizeInPixels()");
  1.2038 +		aText.Append(LogScreenDeviceSizeInPixels);
  1.2039 +		}
  1.2040 +		break;
  1.2041 +	case EWsSdOpTwipsSize:
  1.2042 +		{
  1.2043 +		_LIT(LogScreenDeviceSizeInTwips,"SizeInTwips()");
  1.2044 +		aText.Append(LogScreenDeviceSizeInTwips);
  1.2045 +		}
  1.2046 +		break;
  1.2047 +	case EWsSdOpDisplayMode:
  1.2048 +		{
  1.2049 +		_LIT(LogScreenDeviceDisplayMode,"DisplayMode()");
  1.2050 +		aText.Append(LogScreenDeviceDisplayMode);
  1.2051 +		}
  1.2052 +		break;
  1.2053 +	case EWsSdOpRectCompare:
  1.2054 +		{
  1.2055 +		_LIT(LogScreenDeviceRectCompare,"RectCompare(%S, %S)");
  1.2056 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect1));
  1.2057 +		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect2));
  1.2058 +		aText.AppendFormat(LogScreenDeviceRectCompare,&buf1,&buf2);
  1.2059 +		}
  1.2060 +		break;
  1.2061 +	case EWsSdOpPointerRect:
  1.2062 +		{
  1.2063 +		_LIT(LogScreenDevicePointerRect,"PointerRect()");
  1.2064 +		aText.Append(LogScreenDevicePointerRect);
  1.2065 +		}
  1.2066 +		break;
  1.2067 +	case EWsSdOpCopyScreenToBitmap:
  1.2068 +		{
  1.2069 +		_LIT(LogScreenDeviceCopyScreenToBitmap,"CopyScreenToBitmap(%d)");
  1.2070 +		aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap,pData.CopyScreenToBitmap->handle);
  1.2071 +		}
  1.2072 +		break;
  1.2073 +	case EWsSdOpCopyScreenToBitmap2:
  1.2074 +		{
  1.2075 +		_LIT(LogScreenDeviceCopyScreenToBitmap2,"CopyScreenToBitmap(%d,%S)");
  1.2076 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.CopyScreenToBitmap2->rect));
  1.2077 +		aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap2,pData.CopyScreenToBitmap2->handle,&buf);
  1.2078 +		}
  1.2079 +		break;
  1.2080 +	case EWsSdOpSetScreenSizeAndRotation:
  1.2081 +		{
  1.2082 +		_LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %S, %d})");
  1.2083 +		TShortBuf buf1(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iPixelSize));
  1.2084 +		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iTwipsSize));
  1.2085 +		aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf1,&buf2,pData.PixelsTwipsAndRotation->iRotation);
  1.2086 +		}
  1.2087 +		break;
  1.2088 +	case EWsSdOpSetScreenSizeAndRotation2:
  1.2089 +		{
  1.2090 +		_LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %d})");
  1.2091 +		TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.PixelsAndRotation->iPixelSize));
  1.2092 +		aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf,pData.PixelsAndRotation->iRotation);
  1.2093 +		}
  1.2094 +		break;
  1.2095 +	case EWsSdOpGetDefaultScreenSizeAndRotation:
  1.2096 +	case EWsSdOpGetDefaultScreenSizeAndRotation2:
  1.2097 +		{
  1.2098 +		_LIT(LogScreenDeviceGetDefaultScreenSizeAndRotation,"GetDefaultScreenSizeAndRotation(...)");
  1.2099 +		aText.Append(LogScreenDeviceGetDefaultScreenSizeAndRotation);
  1.2100 +		}
  1.2101 +		break;
  1.2102 +	case EWsSdOpGetNumScreenModes:
  1.2103 +		{
  1.2104 +		_LIT(LogScreenDeviceNumScreenModes,"NumScreenModes");
  1.2105 +		aText.Append(LogScreenDeviceNumScreenModes);
  1.2106 +		}
  1.2107 +		break;
  1.2108 +	case EWsSdOpSetScreenMode:
  1.2109 +		{
  1.2110 +		_LIT(LogScreenDeviceSetScreenMode,"ScreenMode(%d)");
  1.2111 +		aText.AppendFormat(LogScreenDeviceSetScreenMode,*pData.Int);
  1.2112 +		}
  1.2113 +		break;
  1.2114 +	case EWsSdOpGetScreenModeSizeAndRotation:
  1.2115 +	case EWsSdOpGetScreenModeSizeAndRotation2:
  1.2116 +		{
  1.2117 +		_LIT(LogScreenDeviceGetScreenModeSizeAndRotation,"GetScreenModeSizeAndRotation(%d)");
  1.2118 +		aText.AppendFormat(LogScreenDeviceGetScreenModeSizeAndRotation,*pData.Int);
  1.2119 +		}
  1.2120 +		break;
  1.2121 +	case EWsSdOpSetScreenModeEnforcement:
  1.2122 +		{
  1.2123 +		_LIT(LogScreenDeviceSetScreenModeEnforcement,"SetScreenModeEnforcement(%d)");
  1.2124 +		aText.AppendFormat(LogScreenDeviceSetScreenModeEnforcement,*pData.Int);
  1.2125 +		}
  1.2126 +		break;
  1.2127 +	case EWsSdOpScreenModeEnforcement:
  1.2128 +		{
  1.2129 +		_LIT(LogScreenDeviceScreenModeEnforcement,"ScreenModeEnforcement");
  1.2130 +		aText.Append(LogScreenDeviceScreenModeEnforcement);
  1.2131 +		}
  1.2132 +		break;
  1.2133 +	case EWsSdOpSetModeRotation:
  1.2134 +		{
  1.2135 +		_LIT(LogScreenDeviceSetModeRotation,"SetModeRotation(%d,%d)");
  1.2136 +		aText.AppendFormat(LogScreenDeviceSetModeRotation,pData.SetScreenRotation->mode,pData.SetScreenRotation->rotation);
  1.2137 +		}
  1.2138 +		break;
  1.2139 +	case EWsSdOpGetRotationList:
  1.2140 +		{
  1.2141 +		_LIT(LogScreenDeviceGetRotationList,"GetRotationList(%d)");
  1.2142 +		aText.AppendFormat(LogScreenDeviceGetRotationList,*pData.Int);
  1.2143 +		}
  1.2144 +		break;
  1.2145 +	case EWsSdOpPaletteAttributes:
  1.2146 +		{
  1.2147 +		_LIT(LogScreenDevicePaletteAttributes,"PaletteAttributes(...)");
  1.2148 +		aText.Append(LogScreenDevicePaletteAttributes);
  1.2149 +		}
  1.2150 +		break;
  1.2151 +	case EWsSdOpSetPalette:
  1.2152 +		{
  1.2153 +		_LIT(LogScreenDeviceSetPalette,"SetPalette(...)");
  1.2154 +		aText.Append(LogScreenDeviceSetPalette);
  1.2155 +		}
  1.2156 +		break;
  1.2157 +	case EWsSdOpGetPalette:
  1.2158 +		{
  1.2159 +		_LIT(LogScreenDeviceGetPalette,"GetPalette()");
  1.2160 +		aText.Append(LogScreenDeviceGetPalette);
  1.2161 +		}
  1.2162 +		break;
  1.2163 +	case EWsSdOpGetScreenMode:
  1.2164 +		{
  1.2165 +		_LIT(LogScreenDeviceGetScreenMode,"CurrentScreenMode()");
  1.2166 +		aText.Append(LogScreenDeviceGetScreenMode);
  1.2167 +		}
  1.2168 +		break;
  1.2169 +	case EWsSdOpGetDefaultScreenModeOrigin:
  1.2170 +		{
  1.2171 +		_LIT(LogScreenDeviceGetDefaultScreenModeOrigin,"GetDefaultScreenModeOrigin()");
  1.2172 +		aText.Append(LogScreenDeviceGetDefaultScreenModeOrigin);
  1.2173 +		}	
  1.2174 +		break;
  1.2175 +	case EWsSdOpGetScreenModeOrigin:
  1.2176 +		{
  1.2177 +		_LIT(LogScreenDeviceGetScreenModeOrigin,"GetScreenModeOrigin(%d)");
  1.2178 +		aText.AppendFormat(LogScreenDeviceGetScreenModeOrigin, *pData.Int);
  1.2179 +		}	
  1.2180 +		break;
  1.2181 +	case EWsSdOpGetScreenModeScale:
  1.2182 +		{
  1.2183 +		_LIT(LogScreenDeviceGetScreenModeScale,"GetScreenModeScale(%d)");
  1.2184 +		aText.AppendFormat(LogScreenDeviceGetScreenModeScale, *pData.Int);
  1.2185 +		}	
  1.2186 +		break;
  1.2187 +	case EWsSdOpGetCurrentScreenModeScale:
  1.2188 +		{
  1.2189 +		_LIT(LogScreenDeviceGetCurrentScreenModeScale,"GetCurrentScreenModeScale()");
  1.2190 +		aText.Append(LogScreenDeviceGetCurrentScreenModeScale);
  1.2191 +		}	
  1.2192 +		break;		
  1.2193 +	case EWsSdOpSetAppScreenMode:
  1.2194 +		{
  1.2195 +		_LIT(LogScreenDeviceSetAppScreenMode,"SetAppScreenMode(%d)");
  1.2196 +		aText.AppendFormat(LogScreenDeviceSetAppScreenMode, *pData.Int);
  1.2197 +		}	
  1.2198 +		break;		
  1.2199 +	case EWsSdOpGetScreenModeScaledOrigin:
  1.2200 +		{
  1.2201 +		_LIT(LogScreenDeviceGetScreenModeScaledOrigin,"GetScreenModeScaledOrigin(%d)");
  1.2202 +		aText.AppendFormat(LogScreenDeviceGetScreenModeScaledOrigin, *pData.Int);
  1.2203 +		}	
  1.2204 +		break;		
  1.2205 +	case EWsSdOpGetCurrentScreenModeScaledOrigin:
  1.2206 +		{
  1.2207 +		_LIT(LogScreenDeviceGetCurrentScreenModeScaledOrigin,"GetCurrentScreenModeScaledOrigin()");
  1.2208 +		aText.Append(LogScreenDeviceGetCurrentScreenModeScaledOrigin);
  1.2209 +		}	
  1.2210 +		break;		
  1.2211 +	case EWsSdOpSetCurrentScreenModeAttributes:
  1.2212 +		{
  1.2213 +		_LIT(LogScreenDeviceSetCurrentScreenModeAttributes,"SetCurrentScreenModeAttributes(%S)");
  1.2214 +		TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.ScreenSizeMode->iScreenSize));
  1.2215 +		aText.AppendFormat(LogScreenDeviceSetCurrentScreenModeAttributes,&buf);
  1.2216 +		}	
  1.2217 +		break;		
  1.2218 +	case EWsSdOpGetCurrentScreenModeAttributes:
  1.2219 +		{
  1.2220 +		_LIT(LogScreenDeviceGetCurrentScreenModeOrigin,"GetCurrentScreenModeAttributes()");
  1.2221 +		aText.Append(LogScreenDeviceGetCurrentScreenModeOrigin);
  1.2222 +		}	
  1.2223 +		break;		
  1.2224 +	case EWsSdOpGetScreenNumber:
  1.2225 +		{
  1.2226 +		_LIT(LogScreenDeviceGetScreenNumber,"GetScreenNumber()");
  1.2227 +		aText.Append(LogScreenDeviceGetScreenNumber);
  1.2228 +		}	
  1.2229 +		break;		
  1.2230 +	case EWsSdOpGetScreenSizeModeList:
  1.2231 +		{
  1.2232 +		_LIT(LogScreenDeviceGetScreenSizeModeList,"GetScreenSizeModeList(RArray<TInt>* aModeList)");
  1.2233 +		aText.Append(LogScreenDeviceGetScreenSizeModeList);
  1.2234 +		}	
  1.2235 +		break;		
  1.2236 +	case EWsSdOpGetScreenModeDisplayMode:
  1.2237 +		{
  1.2238 +		_LIT(LogScreenDeviceGetScreenModeDisplayMode,"GetScreenModeDisplayMode(%d)");
  1.2239 +		aText.AppendFormat(LogScreenDeviceGetScreenModeDisplayMode, *pData.Int);
  1.2240 +		}	
  1.2241 +		break;		
  1.2242 +	case EWsClOpSetBackLight:
  1.2243 +		{
  1.2244 +		_LIT(LogScreenDeviceSetBackLight,"SetBackLight(%u)");
  1.2245 +		aText.AppendFormat(LogScreenDeviceSetBackLight, *pData.UInt);
  1.2246 +		}	
  1.2247 +		break;		
  1.2248 +	default:
  1.2249 +		UnKnownOpcode(aText, aOpcode);
  1.2250 +		break;
  1.2251 +		}
  1.2252 +	}
  1.2253 +
  1.2254 +void TWsDecoder::DecodeAnimDll(TBuf<LogTBufSize>& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle)
  1.2255 +	{
  1.2256 +	aText.Format(_L("CAnimDll[%d]::"),aHandle);
  1.2257 +	switch (aOpcode)
  1.2258 +		{
  1.2259 +	case EWsAnimDllOpCreateInstance:
  1.2260 +		TDebugLogTextHandler::Append(aText, _L("CreateInstance(...)"));
  1.2261 +		break;
  1.2262 +	case EWsAnimDllOpDestroyInstance:
  1.2263 +		TDebugLogTextHandler::Append(aText, LogClose);
  1.2264 +		break;
  1.2265 +	case EWsAnimDllOpCommandReply:
  1.2266 +		TDebugLogTextHandler::Append(aText, _L("CommandReply(...)"));
  1.2267 +		break;
  1.2268 +	case EWsAnimDllOpCommand:
  1.2269 +		TDebugLogTextHandler::Append(aText, _L("Command(...)"));
  1.2270 +		break;
  1.2271 +	case EWsAnimDllOpFree:
  1.2272 +		aText.Append(_L("~CAnimDll()"));
  1.2273 +		break;
  1.2274 +	case EWsAnimDllOpCreateInstanceSprite:
  1.2275 +		aText.Append(_L("EWsAnimDllOpCreateInstanceSprite enum"));
  1.2276 +		break;
  1.2277 +	default:
  1.2278 +		UnKnownOpcode(aText, aOpcode);
  1.2279 +		break;
  1.2280 +		}
  1.2281 +	}
  1.2282 +
  1.2283 +void TWsDecoder::DecodeSpriteBase(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.2284 +	{
  1.2285 +	TWsSpriteCmdUnion pData;
  1.2286 +
  1.2287 +	aText.Format(_L("RWsSpriteBase[%d]::"),aHandle);
  1.2288 +	pData.any=aCmdData;
  1.2289 +	switch (aOpcode)
  1.2290 +		{
  1.2291 +	case EWsSpriteOpFree:
  1.2292 +		aText.Append(LogClose);
  1.2293 +		break;
  1.2294 +	case EWsSpriteOpSetPosition:
  1.2295 +		aText.Append(_L("SetPosition(...)"));
  1.2296 +		break;
  1.2297 +	case EWsSpriteOpUpdateMember:
  1.2298 +		aText.AppendFormat(_L("UpdateMember(%d)"),pData.UpdateMember->index);
  1.2299 +		break;
  1.2300 +	case EWsSpriteOpUpdateMember2:
  1.2301 +		aText.AppendFormat(_L("UpdateMember(%d,{%d,%d,%d,%d,{%d,%d},%d})"),pData.UpdateMember->index,
  1.2302 +								pData.UpdateMember->data.iBitmap,pData.UpdateMember->data.iMaskBitmap,
  1.2303 +								pData.UpdateMember->data.iInvertMask,pData.UpdateMember->data.iDrawMode,
  1.2304 +								pData.UpdateMember->data.iOffset.iX,pData.UpdateMember->data.iOffset.iY,
  1.2305 +								pData.UpdateMember->data.iInterval.Int());
  1.2306 +		break;
  1.2307 +	case EWsSpriteOpAppendMember:
  1.2308 +		aText.Append(_L("AppendMember(...)"));
  1.2309 +		break;
  1.2310 +	case EWsSpriteOpActivate:
  1.2311 +		aText.Append(_L("Activate()"));
  1.2312 +		break;
  1.2313 +	default:
  1.2314 +		UnKnownOpcode(aText, aOpcode);
  1.2315 +		break;
  1.2316 +		}
  1.2317 +	}
  1.2318 +
  1.2319 +void TWsDecoder::DecodeBitmap(TBuf<LogTBufSize>& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle)
  1.2320 +	{
  1.2321 +	aText.Format(_L("CWsBitmap[%d]::"),aHandle);
  1.2322 +	switch (aOpcode)
  1.2323 +		{
  1.2324 +	case EWsBitmapOpFree:
  1.2325 +		aText.Append(LogClose);
  1.2326 +		break;
  1.2327 +	default:
  1.2328 +		UnKnownOpcode(aText, aOpcode);
  1.2329 +		break;
  1.2330 +		}
  1.2331 +	}
  1.2332 +
  1.2333 +void TWsDecoder::DecodeDirect(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.2334 +	{
  1.2335 +	TWsDirectCmdUnion pData;
  1.2336 +	
  1.2337 +	_LIT(KClassName,"RDirectScreenAccess[%d]::");
  1.2338 +	aText.Format(KClassName,aHandle);
  1.2339 +	pData.any=aCmdData;
  1.2340 +	switch (aOpcode)
  1.2341 +		{
  1.2342 +	case EWsDirectOpFree:
  1.2343 +		aText.Append(LogClose);
  1.2344 +		break;
  1.2345 +	case EWsDirectOpRequest:
  1.2346 +		{
  1.2347 +		_LIT(LogDirectRequest,"Request(TInt *stat,%d)");
  1.2348 +		aText.AppendFormat(LogDirectRequest,hHandleToValue(*pData.Int));
  1.2349 +		}
  1.2350 +		break;
  1.2351 +	case EWsDirectOpInitFailed:
  1.2352 +		{
  1.2353 +		_LIT(LogDirectInitFailed,"InitFailed()");
  1.2354 +		aText.Append(LogDirectInitFailed);
  1.2355 +		}
  1.2356 +		break;
  1.2357 +	case EWsDirectOpGetRegion:
  1.2358 +		{
  1.2359 +		_LIT(LogDirectGetRegion,"GetRegion(%d)");
  1.2360 +		aText.AppendFormat(LogDirectGetRegion,*pData.Int);
  1.2361 +		}
  1.2362 +		break;
  1.2363 +	case EWsDirectOpCancel:
  1.2364 +		{
  1.2365 +		_LIT(LogDirectCancel,"Cancel()");
  1.2366 +		aText.Append(LogDirectCancel);
  1.2367 +		}
  1.2368 +		break;
  1.2369 +	case EWsDirectOpGetSendQueue:
  1.2370 +		{
  1.2371 +		_LIT(LogGetSendQueue,"EWsDirectOpGetSendQueue enum");
  1.2372 +		aText.Append(LogGetSendQueue);
  1.2373 +		}
  1.2374 +		break;	
  1.2375 +	case EWsDirectOpGetRecQueue:
  1.2376 +		{
  1.2377 +		_LIT(LogGetRecQueue,"EWsDirectOpGetRecQueue enum");
  1.2378 +		aText.Append(LogGetRecQueue);
  1.2379 +		}
  1.2380 +		break;	
  1.2381 +	default:
  1.2382 +		UnKnownOpcode(aText, aOpcode);
  1.2383 +		break;
  1.2384 +		}
  1.2385 +	}
  1.2386 +
  1.2387 +void TWsDecoder::DecodeClick(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.2388 +	{
  1.2389 +	TWsClickCmdUnion pData;
  1.2390 +
  1.2391 +	_LIT(KClassName,"RSoundPlugIn[%d]::");
  1.2392 +	aText.Format(KClassName,aHandle);
  1.2393 +	pData.any=aCmdData;
  1.2394 +	switch (aOpcode)
  1.2395 +		{
  1.2396 +	case EWsClickOpFree:
  1.2397 +		aText.Append(LogClose);
  1.2398 +		break;
  1.2399 +	case EWsClickOpIsLoaded:
  1.2400 +		{
  1.2401 +		_LIT(LogClickIsLoaded,"IsLoaded()");
  1.2402 +		aText.Append(LogClickIsLoaded);
  1.2403 +		}
  1.2404 +		break;
  1.2405 +	case EWsClickOpUnLoad:
  1.2406 +		{
  1.2407 +		_LIT(LogClickUnLoad,"UnLoad()");
  1.2408 +		aText.Append(LogClickUnLoad);
  1.2409 +		}
  1.2410 +		break;
  1.2411 +	case EWsClickOpLoad:
  1.2412 +		{
  1.2413 +		_LIT(LogClickLoad1,"Load(\"");
  1.2414 +		_LIT(LogClickLoad2,"\")");
  1.2415 +		TDebugLogTextHandler::Append(aText, LogClickLoad1);
  1.2416 +		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.Int+1), *pData.Int));
  1.2417 +		TDebugLogTextHandler::Append(aText, LogClickLoad2);
  1.2418 +		}
  1.2419 +		break;
  1.2420 +	case EWsClickOpCommandReply:
  1.2421 +		{
  1.2422 +		_LIT(LogClickCommandReply,"CommandReply(...)");
  1.2423 +		aText.Append(LogClickCommandReply);
  1.2424 +		}
  1.2425 +		break;
  1.2426 +	case EWsClickOpSetKeyClick:
  1.2427 +		{			
  1.2428 +		_LIT(LogSetKeyClick,"SetKeyClick(%u)");
  1.2429 +		aText.AppendFormat(LogSetKeyClick, *pData.Bool);
  1.2430 +		}
  1.2431 +		break;
  1.2432 +	case EWsClickOpSetPenClick:
  1.2433 +		{			
  1.2434 +		_LIT(LogSetPenClick,"SetPenClick(%u)");
  1.2435 +		aText.AppendFormat(LogSetPenClick, *pData.Bool);
  1.2436 +		}	
  1.2437 +		break;
  1.2438 +	case EWsClickOpKeyClickEnabled:
  1.2439 +		{
  1.2440 +		_LIT(LogKeyClickEnabled,"KeyClickEnabled()");
  1.2441 +		aText.Append(LogKeyClickEnabled);
  1.2442 +		}
  1.2443 +		break;
  1.2444 +	case EWsClickOpPenClickEnabled:
  1.2445 +		{
  1.2446 +		_LIT(LogPenClickEnabled,"PenClickEnabled()");
  1.2447 +		aText.Append(LogPenClickEnabled);
  1.2448 +		}
  1.2449 +		break;
  1.2450 +	default:
  1.2451 +		UnKnownOpcode(aText, aOpcode);
  1.2452 +		break;
  1.2453 +		}
  1.2454 +	}
  1.2455 +
  1.2456 +TDesC &TWsDecoder::replyBufDetails(TInt aClass, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
  1.2457 +	{
  1.2458 +	iCommandDetailsText.Format(_L("Reply Buffer: "));
  1.2459 +	switch (aClass)
  1.2460 +		{
  1.2461 +	case WS_HANDLE_GROUP_WINDOW:
  1.2462 +		ReplyBufWindowGroup(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
  1.2463 +		break;
  1.2464 +	case WS_HANDLE_CLIENT:
  1.2465 +		ReplyBufClient(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
  1.2466 +		break;
  1.2467 +	case WS_HANDLE_WINDOW:
  1.2468 +		ReplyBufWindow(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
  1.2469 +		break;
  1.2470 +	case WS_HANDLE_SCREEN_DEVICE:
  1.2471 +		ReplyBufScreenDevice(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
  1.2472 +		break;
  1.2473 +	default:
  1.2474 +		iCommandDetailsText.Format(_L("Reply buffer not handled (%u)"), aClass);
  1.2475 +		UnKnown();
  1.2476 +		break;
  1.2477 +		}
  1.2478 +	return iCommandDetailsText;
  1.2479 +	}
  1.2480 +
  1.2481 +TDesC &TWsDecoder::commandDetails(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
  1.2482 +	{
  1.2483 +	switch (aClass)
  1.2484 +		{
  1.2485 +	case WS_HANDLE_ROOT_WINDOW:
  1.2486 +		iCommandDetailsText.Format(_L("invalid class"));
  1.2487 +		break;
  1.2488 +	case WS_HANDLE_GROUP_WINDOW:
  1.2489 +		DecodeWindowGroup(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2490 +		break;
  1.2491 +	case WS_HANDLE_CLIENT:
  1.2492 +		DecodeClient(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2493 +		break;
  1.2494 +	case WS_HANDLE_WINDOW:
  1.2495 +		DecodeWindow(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2496 +		break;
  1.2497 +	case WS_HANDLE_GC:
  1.2498 +		DecodeGc(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2499 +		break;
  1.2500 +	case WS_HANDLE_SCREEN_DEVICE:
  1.2501 +		DecodeScreenDevice(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2502 +		break;
  1.2503 +	case WS_HANDLE_ANIM_DLL:
  1.2504 +		DecodeAnimDll(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2505 +		break;
  1.2506 +	case WS_HANDLE_SPRITE:
  1.2507 +	case WS_HANDLE_POINTER_CURSOR:
  1.2508 +	case WS_HANDLE_TEXT_CURSOR:
  1.2509 +		DecodeSpriteBase(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2510 +		break;
  1.2511 +	case WS_HANDLE_BITMAP:
  1.2512 +		DecodeBitmap(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2513 +		break;
  1.2514 +	case WS_HANDLE_DIRECT:
  1.2515 +		DecodeDirect(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2516 +		break;
  1.2517 +	case WS_HANDLE_CLICK:
  1.2518 +		DecodeClick(iCommandDetailsText, aOpcode, aCmdData, aHandle);
  1.2519 +		break;
  1.2520 +	default:
  1.2521 +		iCommandDetailsText.Format(_L("unknown class (%u)"), aClass);
  1.2522 +		UnKnown();
  1.2523 +		break;
  1.2524 +		}
  1.2525 +	iRequestFuncClass=aClass;
  1.2526 +	iPrevOpcode=aOpcode;
  1.2527 +	return iCommandDetailsText;
  1.2528 +	}
  1.2529 +
  1.2530 +TDesC &TWsDecoder::eventDetails(const TWsEvent *aWsEvent)
  1.2531 +	{
  1.2532 +	switch (aWsEvent->Type())
  1.2533 +		{
  1.2534 +	case EEventKey:
  1.2535 +		iEventDetailsText.Format(_L("EEventKey (code %u, scanCode %u, mdfs 0x%04x, repeats %u)"),
  1.2536 +											aWsEvent->Key()->iCode,
  1.2537 +											aWsEvent->Key()->iScanCode,
  1.2538 +											aWsEvent->Key()->iModifiers,
  1.2539 +											aWsEvent->Key()->iRepeats);
  1.2540 +		break;
  1.2541 +	case EEventKeyUp:
  1.2542 +		iEventDetailsText.Format(_L("EEventKeyUp (scanCode %u, mdfs 0x%04x)"),
  1.2543 +											aWsEvent->Key()->iScanCode,
  1.2544 +											aWsEvent->Key()->iModifiers);
  1.2545 +		break;
  1.2546 +	case EEventKeyDown:
  1.2547 +		iEventDetailsText.Format(_L("EEventKeyDown (scanCode %u, mdfs 0x%04x)"),
  1.2548 +											aWsEvent->Key()->iScanCode,
  1.2549 +											aWsEvent->Key()->iModifiers);
  1.2550 +		break;
  1.2551 +	case EEventPointer:
  1.2552 +		{
  1.2553 +		TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType));
  1.2554 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition));
  1.2555 +		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition));
  1.2556 +		iEventDetailsText.Format(_L("EEventPointer (type %S, modifiers 0x%x, pos %S, global-pos %S)"),
  1.2557 +											&buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3);
  1.2558 +		}
  1.2559 +		break;
  1.2560 +	case EEventDragDrop:
  1.2561 +		{
  1.2562 +		TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType));
  1.2563 +		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition));
  1.2564 +		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition));
  1.2565 +		iEventDetailsText.Format(_L("EEventDragDrop (type %S, modifiers 0x%x, pos %S, global-pos %S)"),
  1.2566 +											&buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3);
  1.2567 +		}
  1.2568 +		break;
  1.2569 +	case EEventPointerEnter:
  1.2570 +		iEventDetailsText.Format(_L("EEventPointerEnter"));
  1.2571 +		break;
  1.2572 +	case EEventPointerExit:
  1.2573 +		iEventDetailsText.Format(_L("EEventPointerExit"));
  1.2574 +		break;
  1.2575 +	case EEventFocusLost:
  1.2576 +		iEventDetailsText.Format(_L("EEventFocusLost"));
  1.2577 +		break;
  1.2578 +	case EEventFocusGained:
  1.2579 +		iEventDetailsText.Format(_L("EEventFocusGained"));
  1.2580 +		break;
  1.2581 +	case EEventModifiersChanged:
  1.2582 +		iEventDetailsText.Format(_L("EEventModifiersChanged"));
  1.2583 +		break;
  1.2584 +	case EEventSwitchOn:
  1.2585 +		iEventDetailsText.Format(_L("EEventSwitchOn"));
  1.2586 +		break;
  1.2587 +	case EEventPassword:
  1.2588 +		iEventDetailsText.Format(_L("EEventPassword"));
  1.2589 +		break;
  1.2590 +	case EEventWindowGroupsChanged:
  1.2591 +		iEventDetailsText.Format(_L("EEventWindowGroupsChanged"));
  1.2592 +		break;
  1.2593 +	case EEventErrorMessage:
  1.2594 +		iEventDetailsText.Format(_L("EEventErrorMessage (%d,%d)"),aWsEvent->ErrorMessage()->iErrorCategory,aWsEvent->ErrorMessage()->iError);
  1.2595 +		break;
  1.2596 +	case EEventMessageReady:
  1.2597 +		iEventDetailsText.Format(_L("EEventMessageReady"));
  1.2598 +		break;
  1.2599 +	case EEventScreenDeviceChanged:
  1.2600 +		iEventDetailsText.Format(_L("EEventScreenDeviceChanged"));
  1.2601 +		break;
  1.2602 +	case EEventSwitchOff:
  1.2603 +		{
  1.2604 +		_LIT(LogEventSwitchOff,"EEventSwitchOff");
  1.2605 +		iEventDetailsText.Format(LogEventSwitchOff);
  1.2606 +		}
  1.2607 +		break;
  1.2608 +	case EEventKeySwitchOff:
  1.2609 +		{
  1.2610 +		_LIT(LogEventKeySwitchOff,"EEventKeySwitchOff");
  1.2611 +		iEventDetailsText.Format(LogEventKeySwitchOff);
  1.2612 +		}
  1.2613 +		break;
  1.2614 +	case EEventFocusGroupChanged:
  1.2615 +		{
  1.2616 +		_LIT(LogEventFocusGroupChanged,"EEventFocusGroupChanged");
  1.2617 +		iEventDetailsText.Format(LogEventFocusGroupChanged);
  1.2618 +		}
  1.2619 +		break;
  1.2620 +	case EEventCaseOpened:
  1.2621 +		{
  1.2622 +		_LIT(LogEventCaseOpened,"EEventCaseOpened");
  1.2623 +		iEventDetailsText.Format(LogEventCaseOpened);
  1.2624 +		}
  1.2625 +		break;
  1.2626 +	case EEventCaseClosed:
  1.2627 +		{
  1.2628 +		_LIT(LogEventCaseClosed,"EEventCaseClosed");
  1.2629 +		iEventDetailsText.Format(LogEventCaseClosed);
  1.2630 +		}
  1.2631 +		break;
  1.2632 +	default:
  1.2633 +		if (aWsEvent->Type()>=EEventUser)
  1.2634 +			iEventDetailsText.Format(_L("EEventUser[%d]"), aWsEvent->Type()-EEventUser);
  1.2635 +		else
  1.2636 +			{
  1.2637 +			UnKnown();
  1.2638 +			iEventDetailsText.Format(_L("Unknown event type=%d "), aWsEvent->Type());
  1.2639 +			}
  1.2640 +		break;
  1.2641 +		}
  1.2642 +	return iEventDetailsText;
  1.2643 +	}
  1.2644 +
  1.2645 +TDesC &TWsDecoder::eventDetails(const TRawEvent *aEvent)
  1.2646 +	{
  1.2647 +	iEventDetailsText.Zero();
  1.2648 +	switch (aEvent->Type())
  1.2649 +		{
  1.2650 +	case TRawEvent::ENone:
  1.2651 +		{
  1.2652 +		_LIT(LogEventDetailsNone,"ENone");
  1.2653 +		iEventDetailsText.Append(LogEventDetailsNone);
  1.2654 +		}
  1.2655 +		break;
  1.2656 +	case TRawEvent::EPointerMove:
  1.2657 +		{
  1.2658 +		_LIT(LogEventDetailsPointerMove,"EPointerMove(");
  1.2659 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2660 +		iEventDetailsText.Append(LogEventDetailsPointerMove);
  1.2661 +		iEventDetailsText.Append(buf);
  1.2662 +		iEventDetailsText.Append(LogCloseBracket);
  1.2663 +		}
  1.2664 +		break;
  1.2665 +    case TRawEvent::EPointerSwitchOn:
  1.2666 +		{
  1.2667 +		_LIT(LogEventDetailsPointerSwitchOn,"EPointerSwitchOn(");
  1.2668 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2669 +		iEventDetailsText.Append(LogEventDetailsPointerSwitchOn);
  1.2670 +		iEventDetailsText.Append(buf);
  1.2671 +		iEventDetailsText.Append(LogCloseBracket);
  1.2672 +		}
  1.2673 +		break;
  1.2674 +	case TRawEvent::EKeyDown:
  1.2675 +		{
  1.2676 +		_LIT(LogEventDetailsKeyDown,"EKeyDown(%d)");
  1.2677 +		iEventDetailsText.Format(LogEventDetailsKeyDown,aEvent->ScanCode());
  1.2678 +		}
  1.2679 +		break;
  1.2680 +	case TRawEvent::EKeyUp:
  1.2681 +		{
  1.2682 +		_LIT(LogEventDetailsKeyUp,"EKeyUp(%d)");
  1.2683 +		iEventDetailsText.Format(LogEventDetailsKeyUp,aEvent->ScanCode());
  1.2684 +		}
  1.2685 +		break;
  1.2686 +	case TRawEvent::ERedraw:
  1.2687 +		{
  1.2688 +		_LIT(LogEventDetailsRedraw,"ERedraw");
  1.2689 +		iEventDetailsText.Append(LogEventDetailsRedraw);
  1.2690 +		}
  1.2691 +		break;
  1.2692 +	case TRawEvent::ESwitchOn:
  1.2693 + 		{
  1.2694 +		_LIT(LogEventDetailsSwitchOn,"ESwitchOn");
  1.2695 +		iEventDetailsText.Append(LogEventDetailsSwitchOn);
  1.2696 +		}
  1.2697 +		break;
  1.2698 +	case TRawEvent::EActive:
  1.2699 +		{
  1.2700 +		_LIT(LogEventDetailsActive,"EActive");
  1.2701 +		iEventDetailsText.Append(LogEventDetailsActive);
  1.2702 +		}
  1.2703 +		break;
  1.2704 +	case TRawEvent::EInactive:
  1.2705 +		{
  1.2706 +		_LIT(LogEventDetailsInactive,"EInactive");
  1.2707 +		iEventDetailsText.Append(LogEventDetailsInactive);
  1.2708 +		}
  1.2709 +		break;
  1.2710 +	case TRawEvent::EUpdateModifiers:
  1.2711 +		{
  1.2712 +		_LIT(LogEventDetailsModifiers,"EUpdateModifiers(%d)");
  1.2713 +		iEventDetailsText.Format(LogEventDetailsModifiers,aEvent->Modifiers());
  1.2714 +		}
  1.2715 +		break;
  1.2716 +	case TRawEvent::EButton1Down:
  1.2717 +		{
  1.2718 +		_LIT(LogEventDetailsButton1Down,"EButton1Down(");
  1.2719 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2720 +		iEventDetailsText.Append(LogEventDetailsButton1Down);
  1.2721 +		iEventDetailsText.Append(buf);
  1.2722 +		iEventDetailsText.Append(LogCloseBracket);
  1.2723 +		}
  1.2724 +		break;
  1.2725 +	case TRawEvent::EButton1Up:
  1.2726 +		{
  1.2727 +		_LIT(LogEventDetailsButton1Up,"EButton1Up(");
  1.2728 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2729 +		iEventDetailsText.Append(LogEventDetailsButton1Up);
  1.2730 +		iEventDetailsText.Append(buf);
  1.2731 +		iEventDetailsText.Append(LogCloseBracket);
  1.2732 +		}
  1.2733 +		break;
  1.2734 +	case TRawEvent::EButton2Down:
  1.2735 +		{
  1.2736 +		_LIT(LogEventDetailsButton2Down,"EButton2Down(");
  1.2737 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2738 +		iEventDetailsText.Append(LogEventDetailsButton2Down);
  1.2739 +		iEventDetailsText.Append(buf);
  1.2740 +		iEventDetailsText.Append(LogCloseBracket);
  1.2741 +		}
  1.2742 +		break;
  1.2743 +	case TRawEvent::EButton2Up:
  1.2744 +		{
  1.2745 +		_LIT(LogEventDetailsButton2Up,"EButton2Up(");
  1.2746 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2747 +		iEventDetailsText.Append(LogEventDetailsButton2Up);
  1.2748 +		iEventDetailsText.Append(buf);
  1.2749 +		iEventDetailsText.Append(LogCloseBracket);
  1.2750 +		}
  1.2751 +		break;
  1.2752 +	case TRawEvent::EButton3Down:
  1.2753 +		{
  1.2754 +		_LIT(LogEventDetailsButton3Down,"EButton3Down(");
  1.2755 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2756 +		iEventDetailsText.Append(LogEventDetailsButton3Down);
  1.2757 +		iEventDetailsText.Append(buf);
  1.2758 +		iEventDetailsText.Append(LogCloseBracket);
  1.2759 +		}
  1.2760 +		break;
  1.2761 +	case TRawEvent::EButton3Up:
  1.2762 +		{
  1.2763 +		_LIT(LogEventDetailsButton3Up,"EButton3Up(");
  1.2764 +		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
  1.2765 +		iEventDetailsText.Append(LogEventDetailsButton3Up);
  1.2766 +		iEventDetailsText.Append(buf);
  1.2767 +		iEventDetailsText.Append(LogCloseBracket);
  1.2768 +		}
  1.2769 +		break;
  1.2770 +	case TRawEvent::ESwitchOff:
  1.2771 +		{
  1.2772 +		_LIT(LogEventDetailsSwitchOff,"ESwitchOff");
  1.2773 +		iEventDetailsText.Append(LogEventDetailsSwitchOff);
  1.2774 +		}
  1.2775 +		break;
  1.2776 +	case TRawEvent::EKeyRepeat:
  1.2777 + 		{
  1.2778 +  		_LIT(LogEventDetailsKeyRepeat,"ERepeatKey(scancode=%d,repeat=%d");
  1.2779 + 		iEventDetailsText.Format(LogEventDetailsKeyRepeat,aEvent->ScanCode(),aEvent->Repeats());
  1.2780 + 		}
  1.2781 +		break;
  1.2782 +	case TRawEvent::EPointer3DOutOfRange:
  1.2783 + 		{
  1.2784 +  		_LIT(LogEventDetailsOutOfRange,"EPointer3DOutOfRange");
  1.2785 + 		iEventDetailsText.Format(LogEventDetailsOutOfRange);
  1.2786 + 		}
  1.2787 +		break;
  1.2788 +	default:
  1.2789 +		{
  1.2790 +		_LIT(LogEventDetailsUnknown,"Unknown event type: %d");
  1.2791 +		iEventDetailsText.Format(LogEventDetailsUnknown,aEvent->Type());
  1.2792 +		UnKnown();
  1.2793 +		}
  1.2794 +		break;
  1.2795 +		}
  1.2796 +	return iEventDetailsText;
  1.2797 +	}
  1.2798 +
  1.2799 +void TWsDecoder::ReplyBufWindowGroup(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
  1.2800 +	{
  1.2801 +	ReplyBufWindow(aText, aOpcode, aReplyDes8, aReplyDesText);
  1.2802 +	}
  1.2803 +
  1.2804 +void TWsDecoder::ReplyBufWindow(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
  1.2805 +	{
  1.2806 +	switch (aOpcode)
  1.2807 +		{
  1.2808 +	case EWsWinOpPosition:
  1.2809 +		AppendPoint(aText,aReplyDes8);
  1.2810 +		break;
  1.2811 +	case EWsWinOpAbsPosition:
  1.2812 +		AppendPoint(aText,aReplyDes8);
  1.2813 +		break;
  1.2814 +	case EWsWinOpSize:
  1.2815 +		AppendPoint(aText,aReplyDes8);
  1.2816 +		break;
  1.2817 +	case EWsWinOpInquireOffset:
  1.2818 +		AppendPoint(aText,aReplyDes8);
  1.2819 +		break;
  1.2820 +	case EWsWinOpName:
  1.2821 +		AppendDesc(aText, aReplyDesText);
  1.2822 +		break;
  1.2823 +	case EWsWinOpRetrievePointerMoveBuffer:
  1.2824 +		aText.Append(_L("..."));
  1.2825 +		break;
  1.2826 +	case EWsWinOpGetInvalidRegion:
  1.2827 +		{
  1.2828 +		TRect *rect=(TRect *)aReplyDes8->Ptr();
  1.2829 +		TInt count=aReplyDes8->Size()/sizeof(TRect);
  1.2830 +		TBuf<2> comma;
  1.2831 +		_LIT(LogTwoStrings,"%S%S");
  1.2832 +		for(TInt index=0;index<count && !iOverflowHandler.IsError();index++)
  1.2833 +			{
  1.2834 +			TLongBuf buf(TDebugLogTextHandler::FormatRect(*rect++));
  1.2835 +			aText.AppendFormat(LogTwoStrings,&iOverflowHandler,&comma,&buf);
  1.2836 +			if (index==0)
  1.2837 +				comma=LogComma;
  1.2838 +			}
  1.2839 +		break;
  1.2840 +		}
  1.2841 +	default:
  1.2842 +		UnKnownReplyBuf(aText, aOpcode);
  1.2843 +		break;
  1.2844 +		}
  1.2845 +	}
  1.2846 +
  1.2847 +void TWsDecoder::ReplyBufClient(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
  1.2848 +	{
  1.2849 +	switch (aOpcode)
  1.2850 +		{
  1.2851 +	case EWsClOpGetEvent:
  1.2852 +		{
  1.2853 +		const TWsEvent *wsEvent=(TWsEvent *)aReplyDes8->Ptr();
  1.2854 +		TPtrC details(eventDetails(wsEvent));
  1.2855 +		aText=KNullDesC;
  1.2856 +		if (details!=KNullDesC)
  1.2857 +			{
  1.2858 +			TDebugLogTextHandler::Append(aText, details);
  1.2859 +			TBuf<128> buf;
  1.2860 +			_LIT(LogReplyClientDestTime,"(dest %d, time ");
  1.2861 +			_LIT(LogReplyClientTime,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S%.%*C2%:3)");
  1.2862 +			buf.Format(LogReplyClientDestTime, wsEvent->Handle());
  1.2863 +			TDebugLogTextHandler::Append(aText, buf);
  1.2864 +			TRAPD(err,wsEvent->Time().FormatL(buf,LogReplyClientTime));
  1.2865 +			if (err==KErrNone)
  1.2866 +				TDebugLogTextHandler::Append(aText, buf);
  1.2867 +			else
  1.2868 +				{
  1.2869 +				_LIT(LogReplyClientTimeErr,"######)");
  1.2870 +				TDebugLogTextHandler::Append(aText,LogReplyClientTimeErr);
  1.2871 +				}
  1.2872 +			}
  1.2873 +		}
  1.2874 +		break;
  1.2875 +	case EWsClOpGetRedraw:
  1.2876 +		{
  1.2877 +		const TWsRedrawEvent *redrawEvent=(TWsRedrawEvent *)aReplyDes8->Ptr();
  1.2878 +		TLongBuf buf(TDebugLogTextHandler::FormatRect(redrawEvent->Rect()));
  1.2879 +		aText.Format(_L("Redraw (handle %d): "), redrawEvent->Handle());
  1.2880 +		aText.AppendFormat(_L("rect %S"), &buf);
  1.2881 +		}
  1.2882 +		break;
  1.2883 +	case EWsClOpGetPriorityKey:
  1.2884 +		{
  1.2885 +		const TWsPriorityKeyEvent *abortEvent=(TWsPriorityKeyEvent *)aReplyDes8->Ptr();
  1.2886 +		aText.Format(_L("Abort key handle %d"), abortEvent->Handle());
  1.2887 +		}
  1.2888 +		break;
  1.2889 +	case EWsClOpShadowVector:
  1.2890 +		AppendPoint(aText,aReplyDes8);
  1.2891 +		break;
  1.2892 +	case EWsClOpGetWindowGroupClientThreadId:
  1.2893 +		{
  1.2894 +		const TThreadId *threadId=(TThreadId *)aReplyDes8->Ptr();
  1.2895 +		aText.Format(_L("TThreadId=%d"), *(TInt *)threadId);
  1.2896 +		}
  1.2897 +		break;
  1.2898 +	case EWsClOpGetWindowGroupNameFromIdentifier:
  1.2899 +		AppendDesc(aText, aReplyDesText);
  1.2900 +		break;
  1.2901 +	case EWsClOpWindowGroupList:
  1.2902 +	case EWsClOpWindowGroupListAndChain: 
  1.2903 +	case EWsClOpWindowGroupListAllPriorities:
  1.2904 +		{
  1.2905 +		TInt *handlPtr=(TInt *)aReplyDes8->Ptr();
  1.2906 +		TInt count=aReplyDes8->Size()/sizeof(TInt);
  1.2907 +		TBuf<2> comma;
  1.2908 +		_LIT(LogStringInt,"%S%d");
  1.2909 +		for(TInt index=0;index<count && !iOverflowHandler.IsError();index++)
  1.2910 +			{
  1.2911 +			aText.AppendFormat(LogStringInt,&iOverflowHandler,&comma,*handlPtr++);
  1.2912 +			if (index==0)
  1.2913 +				comma=LogComma;
  1.2914 +			}
  1.2915 +		}
  1.2916 +		break;
  1.2917 +	case EWsClOpGetKeyboardRepeatRate:
  1.2918 +		{
  1.2919 +		SKeyRepeatSettings *settings=(SKeyRepeatSettings *)aReplyDes8->Ptr();
  1.2920 +		aText.AppendFormat(_L("initial=%d,normal=%d"),settings->iInitialTime.Int(),settings->iTime.Int());
  1.2921 +		}
  1.2922 +		break;
  1.2923 +	case EWsClOpGetDoubleClickSettings:
  1.2924 +		{
  1.2925 +		SDoubleClickSettings *settings=(SDoubleClickSettings *)aReplyDes8->Ptr();
  1.2926 +		aText.AppendFormat(_L("interval=%d,distance=%d"),settings->iInterval.Int(),settings->iDistance);
  1.2927 +		}
  1.2928 +		break;
  1.2929 +	case EWsClOpFetchMessage:
  1.2930 +		{
  1.2931 +		_LIT(LogClientRetFetchMessage,"FetchMessage");
  1.2932 +		aText.Append(LogClientRetFetchMessage);
  1.2933 +		}
  1.2934 +		break;
  1.2935 +	case EWsClOpCreateGraphic:
  1.2936 +		aText.AppendFormat(_L("Creating graphic: %s"), aReplyDes8);
  1.2937 +		break;
  1.2938 +	case EWsClOpGetGraphicMessage: 
  1.2939 +		aText.AppendFormat(_L("Graphic message: %s"), aReplyDes8);
  1.2940 +		break;
  1.2941 +	case EWsClOpPointerCursorPosition:
  1.2942 +		{
  1.2943 +		TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr();
  1.2944 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area));
  1.2945 +		aText.AppendFormat(_L("Cursor position area=%S"), &buf1);
  1.2946 +		}
  1.2947 +		break;
  1.2948 +	case EWsClOpPointerCursorArea:
  1.2949 +		{
  1.2950 +		TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr();
  1.2951 +		TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area));
  1.2952 +		aText.AppendFormat(_L("Cursor area=%S"), &buf1);
  1.2953 +		}
  1.2954 +		break;
  1.2955 +	case EWsClOpGetDefModeMaxNumColors:
  1.2956 +		{
  1.2957 +		SDefModeMaxNumColors *settings=(SDefModeMaxNumColors*)aReplyDes8->Ptr();
  1.2958 +		aText.AppendFormat(_L("Num of colors=%d, num of grays=%d, display mode=%d"),settings->iColors, settings->iGrays, settings->iDisplayMode);
  1.2959 +		}
  1.2960 +		break;
  1.2961 +	default:
  1.2962 +		UnKnownReplyBuf(aText, aOpcode);
  1.2963 +		break;
  1.2964 +		}
  1.2965 +	}
  1.2966 +
  1.2967 +void TWsDecoder::ReplyBufScreenDevice(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *)
  1.2968 +	{
  1.2969 +	switch (aOpcode)
  1.2970 +		{
  1.2971 +	case EWsSdOpGetScanLine:
  1.2972 +		{			//This fills up the log two much for test code
  1.2973 +		aText=KNullDesC;
  1.2974 +		//Alternate code that would log this information.
  1.2975 +		/*_LIT(LogScreenDeviceReplyBufGetScanLine,"aScanLine set to ...");
  1.2976 +		aText=LogScreenDeviceReplyBufGetScanLine;*/
  1.2977 +		/*TDebugLogTextHandler::Append(aText, TDebugLogTextHandler::FormatArray(TDebugLogTextHandler::ERgb,
  1.2978 +														((TDesC8 *)aReplyData)->Ptr(),((TDesC8 *)aReplyData)->Length()*sizeof(TRgb)));*/
  1.2979 +		}
  1.2980 +		break;
  1.2981 +	case EWsSdOpHorizontalTwipsToPixels:
  1.2982 +	case EWsSdOpVerticalTwipsToPixels:
  1.2983 +	case EWsSdOpHorizontalPixelsToTwips:
  1.2984 +	case EWsSdOpVerticalPixelsToTwips:
  1.2985 +	case EWsSdOpPixelSize:
  1.2986 +	case EWsSdOpTwipsSize:
  1.2987 +		AppendPoint(aText,aReplyDes8);
  1.2988 +		break;
  1.2989 +	case EWsSdOpPointerRect:
  1.2990 +		AppendRect(aText,aReplyDes8);
  1.2991 +		break;
  1.2992 +	case EWsSdOpGetDefaultScreenSizeAndRotation:
  1.2993 +	case EWsSdOpGetScreenModeSizeAndRotation:
  1.2994 +		{
  1.2995 +		_LIT(LogScreenDeviceReplyBufPTR,"%S %S %d");
  1.2996 +		const TPixelsTwipsAndRotation *sar=(TPixelsTwipsAndRotation *)aReplyDes8->Ptr();
  1.2997 +		TShortBuf buf1(TDebugLogTextHandler::FormatSize(sar->iPixelSize));
  1.2998 +		TShortBuf buf2(TDebugLogTextHandler::FormatSize(sar->iTwipsSize));
  1.2999 +		aText.AppendFormat(LogScreenDeviceReplyBufPTR,&buf1,&buf2,sar->iRotation);
  1.3000 +		}
  1.3001 +		break;
  1.3002 +	case EWsSdOpGetDefaultScreenSizeAndRotation2:
  1.3003 +	case EWsSdOpGetScreenModeSizeAndRotation2:
  1.3004 +		{
  1.3005 +		_LIT(LogScreenDeviceReplyBufPR,"%S %d");
  1.3006 +		const TPixelsAndRotation *sar=(TPixelsAndRotation *)aReplyDes8->Ptr();
  1.3007 +		TShortBuf buf(TDebugLogTextHandler::FormatSize(sar->iPixelSize));
  1.3008 +		aText.AppendFormat(LogScreenDeviceReplyBufPR,&buf,sar->iRotation);
  1.3009 +		}
  1.3010 +		break;
  1.3011 +	case EWsSdOpGetPalette:
  1.3012 +		{
  1.3013 +		_LIT(LogScreenDeviceReplyBufGetPalette,"Palette returned ...");
  1.3014 +		aText.Append(LogScreenDeviceReplyBufGetPalette);
  1.3015 +		}
  1.3016 +		break;
  1.3017 +	case EWsSdOpGetDefaultScreenModeOrigin:	
  1.3018 +		{
  1.3019 +		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
  1.3020 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
  1.3021 +		_LIT(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin,"Default screen mode origin=%S");
  1.3022 +		aText.AppendFormat(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin, &buf1);
  1.3023 +		}
  1.3024 +		break;
  1.3025 +	case EWsSdOpGetScreenModeOrigin:	
  1.3026 +		{
  1.3027 +		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
  1.3028 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
  1.3029 +		_LIT(LogScreenDeviceReplyBufGetScreenModeOrigin,"Screen mode origin=%S");
  1.3030 +		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeOrigin, &buf1);
  1.3031 +		}
  1.3032 +		break;
  1.3033 +	case EWsSdOpGetScreenModeScale: 	
  1.3034 +	case EWsSdOpGetCurrentScreenModeScale:	
  1.3035 +		{
  1.3036 +		const TSize *size = reinterpret_cast<const TSize*>(aReplyDes8->Ptr());
  1.3037 +		TShortBuf buf1(TDebugLogTextHandler::FormatSize(*size));
  1.3038 +		_LIT(LogScreenDeviceReplyBufGetScreenScale,"Screen scale=%S");
  1.3039 +		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenScale, &buf1);
  1.3040 +		}
  1.3041 +		break;
  1.3042 +	case EWsSdOpGetScreenModeScaledOrigin: 
  1.3043 +		{
  1.3044 +		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
  1.3045 +		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
  1.3046 +		_LIT(LogScreenDeviceReplyBufGetScreenModeScaledOrigin,"Screen mode scaled origin=%S");
  1.3047 +		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeScaledOrigin, &buf1);
  1.3048 +		}
  1.3049 +		break;
  1.3050 +	case EWsSdOpGetCurrentScreenModeAttributes:	
  1.3051 +		{
  1.3052 +		TSizeMode *settings=(TSizeMode*)aReplyDes8->Ptr();
  1.3053 +		TShortBuf origin(TDebugLogTextHandler ::FormatPoint(settings->iOrigin));
  1.3054 +		TShortBuf size(TDebugLogTextHandler ::FormatSize(settings->iScreenSize));
  1.3055 +		TShortBuf area(TDebugLogTextHandler ::FormatRect(settings->iPointerCursorArea));
  1.3056 +		aText.AppendFormat(_L("Screen attribute: origin=%S, size=%s, rotation=%d, area=$s, display mode = %d"), 
  1.3057 +							   &origin, &size, settings->iAlternativeRotations, &area, settings->iDefaultDisplayMode);
  1.3058 +		}
  1.3059 +		break;
  1.3060 +	case EWsSdOpGetScreenSizeModeList:	
  1.3061 +		AppendDesc(aText, aReplyDes8);
  1.3062 +		break;	
  1.3063 +	default:
  1.3064 +		UnKnownReplyBuf(aText, aOpcode);
  1.3065 +		break;
  1.3066 +		}
  1.3067 +	}