windowing/windowserver/debuglog/DECODER.CPP
changeset 0 5d03bc08d59c
child 18 5e30ef2e26cb
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Decodes data into text - platform independent
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "../SERVER/w32cmd.h"
       
    19 #include "DEBUGLOG.H"
       
    20 
       
    21 _LIT(LogCloseBracket,")");
       
    22 _LIT(LogComma,", ");
       
    23 _LIT(LogString,"%S");
       
    24 _LIT(LogClose,"Close()");
       
    25 _LIT(LogSpaces,"  ");
       
    26 
       
    27 void TDebugLogOverflow::Overflow(TDes &aDes)
       
    28 	{
       
    29 	if (!iError)		//Should never be re-entrant but just in case
       
    30 		{
       
    31 		_LIT(OverflowThreeDots,"...");
       
    32 		const TInt LenThreeDots=3;
       
    33 		iError=ETrue;
       
    34 		TInt length=aDes.MaxLength();
       
    35 		if (length>LenThreeDots)
       
    36 			{
       
    37 			length-=LenThreeDots;
       
    38 			if (aDes.Length()>length)
       
    39 				aDes.SetLength(length);
       
    40 			}
       
    41 		aDes.AppendFormat(OverflowThreeDots,this);
       
    42 		}
       
    43 	}
       
    44 
       
    45 class TRawEventX : public TRawEvent
       
    46 // For bypassing protected members of TRawEvent
       
    47 	{
       
    48 public:
       
    49 	inline TUint Ticks();
       
    50 	inline TInt posx();
       
    51 	inline TInt posy();
       
    52 	inline TInt scanCode();
       
    53 	};
       
    54 
       
    55 inline TUint TRawEventX::Ticks()
       
    56 	{return(iTicks);}
       
    57 inline TInt TRawEventX::posx()
       
    58 	{return(iU.pos.x);}
       
    59 inline TInt TRawEventX::posy()
       
    60 	{return(iU.pos.y);}
       
    61 inline TInt TRawEventX::scanCode()
       
    62 	{return(iU.key.scanCode __REMOVE_WINS_CHARCODE);}
       
    63 
       
    64 
       
    65 GLDEF_C TInt hHandleToValue(TUint32 handle)
       
    66 	{
       
    67 	return(handle&0xFFFF);
       
    68 	}
       
    69 
       
    70 TDesC &TWsDecoder::CommandBuf(TInt aApp)
       
    71 	{
       
    72 	iText.Format(_L("[start of command buffer from app %d]"), aApp);
       
    73 	return iText;
       
    74 	}
       
    75 
       
    76 TDesC &TWsDecoder::Command(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
    77 	{
       
    78 	TPtrC details(commandDetails(aClass, aOpcode, aCmdData, aHandle));
       
    79 	iText=KNullDesC;
       
    80 	if (details!=KNullDesC)
       
    81 		iText=details;
       
    82 	return iText;
       
    83 	}
       
    84 
       
    85 TDesC &TWsDecoder::NewClient(TUint aConnectionHandle)
       
    86 	{
       
    87 	iText.Format(_L("Client Connected %d"), aConnectionHandle);
       
    88 	iRequestFuncClass=ENewClientClass;
       
    89 	return iText;
       
    90 	}
       
    91 
       
    92 TDesC &TWsDecoder::CommandReply(TInt aData)
       
    93 	{
       
    94 	iText.Format(_L("returns %d (0x%x)"), aData, aData);
       
    95 	return iText;
       
    96 	}
       
    97 
       
    98 TDesC &TWsDecoder::CommandReplyBuf(const TDesC8 &aDes)
       
    99 	{
       
   100 	TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, &aDes, NULL));
       
   101 	iText=KNullDesC;
       
   102 	if (details!=KNullDesC)
       
   103 		{
       
   104 		iText=LogSpaces;
       
   105 		TDebugLogTextHandler::Append(iText, details);
       
   106 		}
       
   107 	return iText;
       
   108 	}
       
   109 
       
   110 TDesC &TWsDecoder::CommandReplyBuf(const TDesC16 &aDes)
       
   111 	{
       
   112 	iOverflowHandler.Reset();
       
   113 	TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, NULL, &aDes));
       
   114 	iText=KNullDesC;
       
   115 	if (details!=KNullDesC)
       
   116 		{
       
   117 		iText=LogSpaces;
       
   118 		TDebugLogTextHandler::Append(iText, details);
       
   119 		}
       
   120 	return iText;
       
   121 	}
       
   122 
       
   123 TDesC &TWsDecoder::SignalEvent(TInt aApp)
       
   124 	{
       
   125 	iText.Format(_L("Event signalled for App %d"),aApp);
       
   126 	return iText;
       
   127 	}
       
   128 
       
   129 TDesC &TWsDecoder::Panic(TInt aApp, TInt aReason)
       
   130 	{
       
   131 	if (aApp==CDebugLogBase::EDummyConnectionId)
       
   132 		iText.Format(_L("WSERV Internal Panic (%d)"), aReason);
       
   133 	else
       
   134 		iText.Format(_L("App %d, Paniced (%d)"),aApp, aReason);
       
   135 	return iText;
       
   136 	}
       
   137 
       
   138 void TWsDecoder::UnKnown()
       
   139 	{
       
   140 	}
       
   141 
       
   142 void TWsDecoder::UnKnownOpcode(TBuf<LogTBufSize> &aText, TInt aOpcode)
       
   143 	{
       
   144 	aText.AppendFormat(_L("unknown function (opcode %u)"), aOpcode);
       
   145 	UnKnown();
       
   146 	}
       
   147 
       
   148 void TWsDecoder::UnKnownReplyBuf(TBuf<LogTBufSize> &aText, TInt aOpcode)
       
   149 	{
       
   150 	aText.AppendFormat(_L("unknown reply buffer (opcode %u)"), aOpcode);
       
   151 	UnKnown();
       
   152 	}
       
   153 
       
   154 TDesC &TWsDecoder::MiscMessage(const TDesC &aFormat,TInt aParam)
       
   155 	{
       
   156 	iText.Format(aFormat,aParam);
       
   157 	return iText;
       
   158 	}
       
   159 
       
   160 void TWsDecoder::AppendPoint(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
       
   161 	{
       
   162 	TShortBuf buf(TDebugLogTextHandler::FormatPoint(*((TPoint *)aReplyDes8->Ptr())));
       
   163 	aText.AppendFormat(LogString, &buf);
       
   164 	}
       
   165 
       
   166 void TWsDecoder::AppendRect(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
       
   167 	{
       
   168 	TLongBuf buf(TDebugLogTextHandler::FormatRect(*((TRect *)aReplyDes8->Ptr())));
       
   169 	aText.AppendFormat(LogString, &buf);
       
   170 	}
       
   171 
       
   172 void TWsDecoder::AppendDesc(TBuf<LogTBufSize> &aText, const TDesC8 *aReplyDes8)
       
   173 	{
       
   174 	TBuf<LogTBufSize> buf;
       
   175 	buf.Copy(*aReplyDes8);
       
   176 	aText.AppendFormat(LogString, &buf);
       
   177 	}
       
   178 
       
   179 void TWsDecoder::AppendDesc(TBuf<LogTBufSize> &aText, const TDesC16 *aReplyDes16)
       
   180 	{
       
   181 	aText.AppendFormat(LogString, aReplyDes16);
       
   182 	}
       
   183 
       
   184 void TWsDecoder::DecodeWindowGroup(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
   185 	{
       
   186 	aText.Format(_L("RWindowGroup[%d]::"),aHandle);
       
   187 	TWsWinCmdUnion pData;
       
   188 	pData.any=aCmdData;
       
   189 	switch (aOpcode)
       
   190 		{
       
   191 	case EWsWinOpReceiveFocus:
       
   192 		aText.AppendFormat(_L("ReceiveFocus(%d)"), pData.Bool);
       
   193 		break;
       
   194 	case EWsWinOpAutoForeground:
       
   195 		aText.AppendFormat(_L("AutoForeground(%d)"), pData.Bool);
       
   196 		break;
       
   197 	case EWsWinOpCancelCaptureKey:
       
   198 		aText.AppendFormat(_L("CancelCaptureKey(%d)"), *pData.UInt);
       
   199 		break;
       
   200 	case EWsWinOpCaptureKey:
       
   201 		aText.AppendFormat(_L("CaptureKey(%u, 0x%04x, 0x%04x)"),
       
   202 									pData.CaptureKey->key,
       
   203 									pData.CaptureKey->modifiers,
       
   204 									pData.CaptureKey->modifierMask);
       
   205 		break;
       
   206 	case EWsWinOpCancelCaptureKeyUpsAndDowns:
       
   207 		aText.AppendFormat(_L("CancelCaptureKeyUpsAndDowns(%d)"), *pData.UInt);
       
   208 		break;
       
   209 	case EWsWinOpCaptureKeyUpsAndDowns:
       
   210 		aText.AppendFormat(_L("CaptureKeyUpsAndDowns(%u, 0x%04x, 0x%04x)"),
       
   211 									pData.CaptureKey->key,
       
   212 									pData.CaptureKey->modifiers,
       
   213 									pData.CaptureKey->modifierMask);
       
   214 		break;
       
   215 	case EWsWinOpSetTextCursor:
       
   216 		{
       
   217 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos));
       
   218 		aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x})"),
       
   219 										hHandleToValue(pData.SetTextCursor->window), &buf,
       
   220 										pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight,
       
   221 										pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth,
       
   222 										pData.SetTextCursor->cursor.iFlags);
       
   223 		}
       
   224 		break;
       
   225 	case EWsWinOpSetTextCursorClipped:
       
   226 		{
       
   227 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos));
       
   228 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.SetTextCursor->rect));
       
   229 		aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x}, %S)"),
       
   230 										hHandleToValue(pData.SetTextCursor->window), &buf1,
       
   231 										pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight,
       
   232 										pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth,
       
   233 										pData.SetTextCursor->cursor.iFlags, &buf2);
       
   234 		}
       
   235 		break;
       
   236 	case EWsWinOpCancelTextCursor:
       
   237 		aText.AppendFormat(_L("CancelTextCursor()"));
       
   238 		break;
       
   239 	case EWsWinOpSetOrdinalPriorityAdjust:
       
   240 		aText.AppendFormat(_L("SetOrdinalPriorityAdjust(%d)"), *pData.Int);
       
   241 		break;
       
   242 	case EWsWinOpAddPriorityKey:
       
   243 		aText.AppendFormat(_L("AddPriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode);
       
   244 		break;
       
   245 	case EWsWinOpRemovePriorityKey:
       
   246 		aText.AppendFormat(_L("RemovePriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode);
       
   247 		break;
       
   248 	case EWsWinOpSetOrdinalPositionErr:
       
   249 		aText.AppendFormat(_L("SetOrdinalPositionErr(%d, %d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority);	
       
   250 		break;
       
   251 	case EWsWinOpDisableKeyClick:
       
   252 		aText.AppendFormat(_L("DisableKeyClick(%u)"), *pData.UInt);	
       
   253 		break;
       
   254 	case EWsWinOpCaptureLongKey:
       
   255 		aText.AppendFormat(_L("CaptureLongKey(TTimeIntervalMicroSeconds32(%d), %u, %u, %u, %u, %d, %u)"), 
       
   256 								pData.CaptureLongKey->delay.Int(), pData.CaptureLongKey->inputKey, pData.CaptureLongKey->outputKey, 
       
   257 								pData.CaptureLongKey->modifierMask, pData.CaptureLongKey->modifiers, pData.CaptureLongKey->priority, pData.CaptureLongKey->flags);	
       
   258 		break;
       
   259 	case EWsWinOpCancelCaptureLongKey:
       
   260 		aText.AppendFormat(_L("CancelCaptureLongKey(%d)"), pData.CaptureKey->key);	
       
   261 		break;
       
   262 	case EWsWinOpAllowChildWindowGroup:
       
   263 		aText.AppendFormat(_L("AllowProcessToCreateChildWindowGroup(%d)"), *pData.Int);	
       
   264 		break;
       
   265 	case EWsWinOpClearChildGroup:
       
   266 		aText.AppendFormat(_L("ClearChildGroup()"));	
       
   267 		break;
       
   268 	case EWsWinOpSetChildGroup:
       
   269 		aText.AppendFormat(_L("SetChildGroup(%d)"), *pData.Int); 	
       
   270 		break;
       
   271 	case EWsWinOpEnableVisibilityChangeEvents:
       
   272 		aText.Append(_L("EnableVisibilityChangeEvents()")); 	
       
   273 		break;
       
   274 	case EWsWinOpDisableVisibilityChangeEvents:
       
   275 		aText.Append(_L("DisableVisibilityChangeEvents()")); 	
       
   276 		break;
       
   277 	case EWsWinOpWindowGroupId:
       
   278 		aText.Append(_L("WindowGroupId()")); 	
       
   279 		break;
       
   280 	case EWsWinOpEnableFocusChangeEvents:
       
   281 		aText.Append(_L("EnableFocusChangeEvents()")); 	
       
   282 		break;
       
   283 	case EWsWinOpDisableFocusChangeEvents:
       
   284 		aText.Append(_L("DisableFocusChangeEvents()")); 	
       
   285 		break;
       
   286 	default:
       
   287 		decodeWindow(aText,aOpcode,aCmdData);
       
   288 		break;
       
   289 		}
       
   290 	}
       
   291 
       
   292 void TWsDecoder::DecodeClient(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
   293 	{
       
   294 	TWsClCmdUnion pData;
       
   295 
       
   296 	aText.Format(_L("RWsSession[%d]::"),aHandle);
       
   297 	pData.any=aCmdData;
       
   298 	switch (aOpcode)
       
   299 		{
       
   300 	case EWsClOpDisconnect:
       
   301 		aText.AppendFormat(LogClose);
       
   302 		break;
       
   303 	case EWsClOpSetHotKey:
       
   304 		aText.AppendFormat(_L("SetHotKey(%u, %u, 0x%04x, 0x%04x)"),
       
   305 										pData.SetHotKey->type,
       
   306 										pData.SetHotKey->keycode,
       
   307 										pData.SetHotKey->modifiers,
       
   308 										pData.SetHotKey->modifierMask);
       
   309 		break;
       
   310 	case EWsClOpClearHotKeys:
       
   311 		aText.AppendFormat(_L("ClearHotKeys(%d)"),*pData.UInt);
       
   312 		break;
       
   313 	case EWsClOpRestoreDefaultHotKey:
       
   314 		aText.AppendFormat(_L("ResetDefaultHotKey(%d)"),*pData.UInt);
       
   315 		break;
       
   316 	case EWsClOpComputeMode:
       
   317 		aText.AppendFormat(_L("ComputeMode(%u)"),*pData.UInt);
       
   318 		break;
       
   319 	case EWsClOpEventReady:
       
   320 		aText.AppendFormat(_L("EventReady(TInt *stat)"));
       
   321 		break;
       
   322 	case EWsClOpRedrawReady:
       
   323 		aText.AppendFormat(_L("RedrawReady(TInt *stat)"));
       
   324 		break;
       
   325 	case EWsClOpPriorityKeyReady:
       
   326 		aText.AppendFormat(_L("PriorityKeyReady(TInt *stat)"));
       
   327 		break;
       
   328 	case EWsClOpEventReadyCancel:
       
   329 		aText.AppendFormat(_L("EventReadyCancel()"));
       
   330 		break;
       
   331 	case EWsClOpRedrawReadyCancel:
       
   332 		aText.AppendFormat(_L("RedrawReadyCancel()"));
       
   333 		break;
       
   334 	case EWsClOpPriorityKeyReadyCancel:
       
   335 		aText.AppendFormat(_L("PriorityKeyReadyCancel()"));
       
   336 		break;
       
   337 	case EWsClOpGetEvent:
       
   338 		aText.AppendFormat(_L("GetEvent(TWsEvent *aEvent)"));
       
   339 		break;
       
   340 	case EWsClOpGetRedraw:
       
   341 		aText.AppendFormat(_L("GetRedraw(TWsRedrawEvent *aEvent)"));
       
   342 		break;
       
   343 	case EWsClOpGetPriorityKey:
       
   344 		aText.AppendFormat(_L("GetPriorityKey(TWsPriorityKeyEvent *aEvent)"));
       
   345 		break;
       
   346 	case EWsClOpCreateWindow:
       
   347 	case EWsClOpCreateGc:
       
   348 	case EWsClOpCreateWindowGroup:
       
   349 	case EWsClOpCreateAnimDll:
       
   350 	case EWsClOpCreateScreenDevice:
       
   351 	case EWsClOpCreateSprite:
       
   352 	case EWsClOpCreatePointerCursor:
       
   353 	case EWsClOpCreateBitmap:
       
   354 	case EWsClOpCreateDirectScreenAccess:
       
   355 	case EWsClOpCreateClick:
       
   356 		switch(aOpcode)
       
   357 			{
       
   358 			case EWsClOpCreateWindow:
       
   359 				aText.AppendFormat(_L("CreateWindow(%d,%x)"),hHandleToValue(pData.CreateWindow->parent),pData.CreateWindow->clientHandle);
       
   360 				break;
       
   361 			case EWsClOpCreateGc:
       
   362 				aText.AppendFormat(_L("CreateGc()"));
       
   363 				break;
       
   364 			case EWsClOpCreateWindowGroup:
       
   365 				aText.AppendFormat(_L("CreateWindowGroup(%x)"),pData.CreateWindow->clientHandle);
       
   366 				break;
       
   367 			case EWsClOpCreateAnimDll:
       
   368 				TDebugLogTextHandler::Append(aText, _L("LoadAnimDll(\""));
       
   369 				if (pData.LoadAnimDll && (pData.LoadAnimDll->length >= 0) && (pData.LoadAnimDll->length < LogTBufSize - 22))
       
   370 					TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.LoadAnimDll+1), pData.LoadAnimDll->length));
       
   371 				else
       
   372 					TDebugLogTextHandler::Append(aText, _L("<INVALID DESCRIPTOR>"));
       
   373 				TDebugLogTextHandler::Append(aText, _L("\")"));
       
   374 				break;
       
   375 			case EWsClOpCreateScreenDevice:
       
   376 				aText.AppendFormat(_L("CreateScreenDevice()"));
       
   377 				break;
       
   378 			case EWsClOpCreateSprite:
       
   379 				aText.AppendFormat(_L("CreateSprite(...)"));
       
   380 				break;
       
   381 			case EWsClOpCreatePointerCursor:
       
   382 				aText.AppendFormat(_L("CreatePointerCursor(...)"));
       
   383 				break;
       
   384 			case EWsClOpCreateBitmap:
       
   385 				aText.AppendFormat(_L("CreateBitmap(...)"));
       
   386 				break;
       
   387 			case EWsClOpCreateDirectScreenAccess:
       
   388 				aText.AppendFormat(_L("CreateDirectScreenAccess()"));
       
   389 				break;
       
   390 			case EWsClOpCreateClick:
       
   391 				aText.AppendFormat(_L("CreateSoundPlugin()"));
       
   392 				break;
       
   393 			}
       
   394 		break;
       
   395 	case EWsClOpHeapCount:
       
   396 		aText.AppendFormat(_L("HeapCount()"));
       
   397 		break;
       
   398 	case EWsClOpDebugInfo:
       
   399 		aText.AppendFormat(_L("DebugInfo(%d,%d)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam);
       
   400 		break;
       
   401 	case EWsClOpDebugInfoReplyBuf:
       
   402 		aText.AppendFormat(_L("DebugInfo(%d,%d,...)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam);
       
   403 		break;
       
   404 	case EWsClOpTestInvariant:
       
   405 		aText.AppendFormat(_L("unimplemented opcode 'EWsClOpTestInvariant' (%u)"), aOpcode);
       
   406 		break;
       
   407 	case EWsClOpSetShadowVector:
       
   408 		{
       
   409 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
   410 		aText.AppendFormat(_L("SetShadowVector(%S)"), &buf);
       
   411 		break;
       
   412 		}
       
   413 	case EWsClOpShadowVector:
       
   414 		aText.Append(_L("ShadowVector()"));
       
   415 		break;
       
   416 	case EWsClOpResourceCount:
       
   417 		aText.Append(_L("ResourceCount()"));
       
   418 		break;
       
   419 	case EWsClOpSetKeyboardRepeatRate:
       
   420 		aText.Append(_L("SetKeyboardRepeatRate(...,...)"));
       
   421 		break;
       
   422 	case EWsClOpGetKeyboardRepeatRate:
       
   423 		aText.Append(_L("GetKeyboardRepeatRate(...,...)"));
       
   424 		break;
       
   425 	case EWsClOpSetDoubleClick:
       
   426 		aText.AppendFormat(_L("SetDoubleClickSettings(...,%d)"), pData.SetDoubleClick->distance);
       
   427 		break;
       
   428 	case EWsClOpGetDoubleClickSettings:
       
   429 		aText.Append(_L("GetDoubleClickSettings(...,...)"));
       
   430 		break;
       
   431 	case EWsClOpHeapSetFail:
       
   432 		aText.AppendFormat(_L("HeapSetFail(%d, %d)"), pData.HeapSetFail->type, pData.HeapSetFail->value);
       
   433 		break;
       
   434 	case EWsClOpNumWindowGroups:
       
   435 		aText.AppendFormat(_L("NumWindowGroups(%d)"),*pData.UInt);
       
   436 		break;
       
   437 	case EWsClOpNumWindowGroupsAllPriorities:
       
   438 		aText.Append(_L("NumWindowGroups()"));
       
   439 		break;
       
   440 	case EWsClOpWindowGroupList:
       
   441 		aText.AppendFormat(_L("WindowGroupList(...,%d,%d)"),pData.WindowGroupList->priority, pData.WindowGroupList->count);
       
   442 		break;
       
   443 	case EWsClOpWindowGroupListAllPriorities:
       
   444 		aText.AppendFormat(_L("WindowGroupList(...,%d)"),pData.WindowGroupList->count);
       
   445 		break;
       
   446 	case EWsClOpGetFocusWindowGroup:
       
   447 		aText.AppendFormat(_L("GetFocusWindowGroup(%d, ...)"), *pData.UInt);
       
   448 		break;
       
   449 	case EWsClOpGetDefaultOwningWindow:
       
   450 		aText.Append(_L("GetDefaultOwningWindow()"));
       
   451 		break;
       
   452 	case EWsClOpSetWindowGroupOrdinalPosition:
       
   453 		aText.AppendFormat(_L("SetWindowGroupOrdinalPosition(%d, %d)"),
       
   454 							pData.SetWindowGroupOrdinalPosition->identifier,
       
   455 							pData.SetWindowGroupOrdinalPosition->position);
       
   456 		break;
       
   457 	case EWsClOpGetWindowGroupHandle:
       
   458 		aText.AppendFormat(_L("GetWindowGroupHandle(%d)"),*pData.Int);
       
   459 		break;
       
   460 	case EWsClOpGetWindowGroupOrdinalPriority:
       
   461 		aText.AppendFormat(_L("GetWindowGroupOrdinalPriority(%d)"),*pData.Int);
       
   462 		break;
       
   463 	case EWsClOpGetWindowGroupClientThreadId:
       
   464 		aText.AppendFormat(_L("GetWindowGroupClientThreadId(%d)"),*pData.Int);
       
   465 		break;
       
   466 	case EWsClOpGetWindowGroupNameFromIdentifier:
       
   467 		aText.AppendFormat(_L("GetWindowGroupNameFromIdentifier(%d)"),pData.GetWindowGroupNameFromIdentifier->identifier);
       
   468 		break;
       
   469 	case EWsClOpFindWindowGroupIdentifier:
       
   470 		aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,...,%d)"),pData.FindWindowGroupIdentifier->identifier,
       
   471 						pData.FindWindowGroupIdentifier->offset);
       
   472 		break;
       
   473 	case EWsClOpFindWindowGroupIdentifierThread:
       
   474 		aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,0x%x)"),pData.FindWindowGroupIdentifierThread->identifier,
       
   475 						pData.FindWindowGroupIdentifierThread->threadId.Id());
       
   476 		break;
       
   477 	case EWsClOpSendMessageToWindowGroup:
       
   478 		aText.AppendFormat(_L("SendMessageToWindowGroup(0x%x,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority,
       
   479 						pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
       
   480 		break;
       
   481 	case EWsClOpSendMessageToAllWindowGroups:
       
   482 		aText.AppendFormat(_L("SendMessageToAllWindowGroups(0x%x,...)"),pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
       
   483 		break;
       
   484 	case EWsClOpSendMessageToAllWindowGroupsPriority:
       
   485 		aText.AppendFormat(_L("SendMessageToAllWindowGroups(%d,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority,
       
   486 						pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength);
       
   487 		break;
       
   488 	case EWsClOpFetchMessage:
       
   489 		aText.AppendFormat(_L("FetchMessage(...)"));
       
   490 		break;
       
   491 	case EWsClOpSetSystemPointerCursor:
       
   492 		aText.AppendFormat(_L("SetSystemPointerCursor(...,%d)"), pData.SetSystemPointerCursor->number);
       
   493 		break;
       
   494 	case EWsClOpClearSystemPointerCursor:
       
   495 		aText.AppendFormat(_L("ClearSystemPointerCursor(%d)"), *pData.UInt);
       
   496 		break;
       
   497 	case EWsClOpClaimSystemPointerCursorList:
       
   498 		aText.Append(_L("ClaimSystemPointerCursorList()"));
       
   499 		break;
       
   500 	case EWsClOpFreeSystemPointerCursorList:
       
   501 		aText.Append(_L("FreeSystemPointerCursorList()"));
       
   502 		break;
       
   503 	case EWsClOpLogMessage:
       
   504 		aText.Append(_L("LogMessage(...)"));
       
   505 		break;
       
   506 	case EWsClOpPasswordEntered:
       
   507 		aText.Append(_L("PasswordEntered()"));
       
   508 		break;
       
   509 	case EWsClOpPurgePointerEvents:
       
   510 		aText.Append(_L("PurgePointerEvents()"));
       
   511 		break;
       
   512 	case EWsClOpRawEvent:
       
   513 		aText.AppendFormat(_L("SimulateRawEvent(%d,%d,{{%d,%d},%d})"),((TRawEventX *)pData.RawEvent)->Type(),
       
   514 								((TRawEventX *)pData.RawEvent)->Ticks(),((TRawEventX *)pData.RawEvent)->posx(),
       
   515 								((TRawEventX *)pData.RawEvent)->posy(),((TRawEventX *)pData.RawEvent)->scanCode());
       
   516 		break;
       
   517 	case EWsClOpSendEventToWindowGroup:
       
   518 		aText.AppendFormat(_L("SendEventToWindowGroup(%d,"),pData.SendEventToWindowGroup->parameter);
       
   519 		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
       
   520 		aText.Append(LogCloseBracket);
       
   521 		break;
       
   522 	case EWsClOpSetModifierState:
       
   523 		aText.AppendFormat(_L("SetModifierState(%d,%d)"), pData.SetModifierState->modifier, pData.SetModifierState->state);
       
   524 		break;
       
   525 	case EWsClOpGetModifierState:
       
   526 		aText.Append(_L("GetModifierState()"));
       
   527 		break;
       
   528 	case EWsClOpSendOffEventsToShell:
       
   529 		{
       
   530 		_LIT(LogClientSendOffEventsToShell,"RequestOffEvents(%u,%d)");
       
   531 		aText.AppendFormat(LogClientSendOffEventsToShell
       
   532 										,pData.OffEventsToShell->on,hHandleToValue(pData.OffEventsToShell->window));
       
   533 		}
       
   534 		break;
       
   535 	case EWsClOpGetDefModeMaxNumColors:
       
   536 		{
       
   537 		_LIT(LogClientGetDefModeMaxNumColors,"GetDefModeMaxNumColors()");
       
   538 		aText.Append(LogClientGetDefModeMaxNumColors);
       
   539 		}
       
   540 		break;
       
   541 	case EWsClOpGetColorModeList:
       
   542 		{
       
   543 		_LIT(LogClientGetColorModeList,"GetColorModeList()");
       
   544 		aText.Append(LogClientGetColorModeList);
       
   545 		}
       
   546 		break;
       
   547 	case EWsClOpKeyEvent:
       
   548 		{
       
   549 		_LIT(LogClientKeyEvent,"SimulateKeyEvent(%d)");
       
   550 		aText.AppendFormat(LogClientKeyEvent,pData.KeyEvent->iCode);
       
   551 		}
       
   552 		break;
       
   553 	case EWsClOpSendEventToAllWindowGroup:
       
   554 		{
       
   555 		_LIT(LogClientSendEventToAllWindowGroups,"SendEventToAllWindowGroups(");
       
   556 		aText.Append(LogClientSendEventToAllWindowGroups);
       
   557 		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
       
   558 		aText.Append(LogCloseBracket);
       
   559 		}
       
   560 		break;
       
   561 	case EWsClOpSendEventToAllWindowGroupPriority:
       
   562 		{
       
   563 		_LIT(LogClientSendEventToAllWindowGroupPriority,"SendEventToAllWindowGroups(%d,");
       
   564 		aText.AppendFormat(LogClientSendEventToAllWindowGroupPriority,pData.SendEventToWindowGroup->parameter);
       
   565 		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
       
   566 		aText.Append(LogCloseBracket);
       
   567 		}
       
   568 		break;
       
   569 	case EWsClOpSetPointerCursorArea:
       
   570 		{
       
   571 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.SetPointerCursorArea->area));
       
   572 		_LIT(LogClientSetPointerCursorArea,"SetPointerCursorArea(%d,%S)");
       
   573 		aText.AppendFormat(LogClientSetPointerCursorArea,pData.SetPointerCursorArea->mode,&buf);
       
   574 		}
       
   575 		break;
       
   576 	case EWsClOpPointerCursorArea:
       
   577 		{
       
   578 		_LIT(LogClientPointerCursorArea,"PointerCursorArea(%d)");
       
   579 		aText.AppendFormat(LogClientPointerCursorArea,*pData.Int);
       
   580 		}
       
   581 		break;
       
   582 	case EWsClOpSetPointerCursorMode:
       
   583 		{
       
   584 		_LIT(LogClientSetPointerCursorMode,"SetPointerCursorMode(%d)");
       
   585 		aText.AppendFormat(LogClientSetPointerCursorMode,*pData.Mode);
       
   586 		}
       
   587 		break;
       
   588 	case EWsClOpPointerCursorMode:
       
   589 		{
       
   590 		_LIT(LogClientPointerCursorMode,"PointerCursorMode()");
       
   591 		aText.Append(LogClientPointerCursorMode);
       
   592 		}
       
   593 		break;
       
   594 	case EWsClOpSetDefaultSystemPointerCursor:
       
   595 		{
       
   596 		_LIT(LogClientSetDefaultSystemPointerCursor,"SetDefaultSystemPointerCursor(%d)");
       
   597 		aText.AppendFormat(LogClientSetDefaultSystemPointerCursor,*pData.Int);
       
   598 		}
       
   599 		break;
       
   600 	case EWsClOpClearDefaultSystemPointerCursor:
       
   601 		{
       
   602 		_LIT(LogClientClearDefaultSystemPointerCursor,"ClearDefaultSystemPointerCursor()");
       
   603 		aText.Append(LogClientClearDefaultSystemPointerCursor);
       
   604 		}
       
   605 		break;
       
   606 	case EWsClOpSetPointerCursorPosition:
       
   607 		{
       
   608 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
   609 		_LIT(LogClientSetPointerCursorPosition,"SetPointerCursorPosition(%S)");
       
   610 		aText.AppendFormat(LogClientSetPointerCursorPosition,&buf);
       
   611 		}
       
   612 		break;
       
   613 	case EWsClOpPointerCursorPosition:
       
   614 		{
       
   615 		_LIT(LogClientPointerCursorPosition,"PointerCursorPosition()");
       
   616 		aText.Append(LogClientPointerCursorPosition);
       
   617 		}
       
   618 		break;
       
   619 	case EWsClOpSetDefaultFadingParams:
       
   620 		{
       
   621 		_LIT(LogClientSetDefaultFadingParams,"SetDefaultFadingParameters(%d,%d)");
       
   622 		aText.AppendFormat(LogClientSetDefaultFadingParams
       
   623 								,WservEncoding::ExtractFirst8BitValue(*pData.UInt),WservEncoding::ExtractSecond8BitValue(*pData.UInt));
       
   624 		}
       
   625 		break;
       
   626 	case EWsClOpPrepareForSwitchOff:
       
   627 		{
       
   628 		_LIT(LogClientPrepareForSwitchOff,"PrepareForSwitchOff()");
       
   629 		aText.Append(LogClientPrepareForSwitchOff);
       
   630 		}
       
   631 		break;
       
   632 	case EWsClOpSetFaded:
       
   633 		{
       
   634 		_LIT(LogWinSetFade,"SetSystemFade(%d");
       
   635 		aText.AppendFormat(LogWinSetFade,pData.SetSystemFaded->Faded());
       
   636 		if (!pData.SetSystemFaded->UseDefaultMap())
       
   637 			{
       
   638 			_LIT(LogWinSetFade2,",%d,%d");
       
   639 			TUint8 blackMap;
       
   640 			TUint8 whiteMap;
       
   641 			pData.SetSystemFaded->GetFadingParams(blackMap,whiteMap);
       
   642 			aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap);
       
   643 			}
       
   644 		aText.Append(LogCloseBracket);
       
   645 		}
       
   646 		break;
       
   647 	case EWsClOpLogCommand:
       
   648 		{
       
   649 		_LIT(LogClientLogCommand,"LogCommand(%d)");
       
   650 		aText.AppendFormat(LogClientLogCommand,*pData.UInt);
       
   651 		}
       
   652 		break;
       
   653 	case EWsClOpSendEventToOneWindowGroupPerClient:
       
   654 		{
       
   655 		_LIT(LogClientSendEventToOneWindowGroupPerClient,"SendEventToOneWindowGroupsPerClient(");
       
   656 		aText.Append(LogClientSendEventToOneWindowGroupPerClient);
       
   657 		aText.Append(eventDetails(&pData.SendEventToWindowGroup->event));
       
   658 		aText.Append(LogCloseBracket);
       
   659 		}
       
   660 		break;
       
   661 	case EWsClOpStartSetCustomTextCursor:
       
   662 		{
       
   663 		_LIT(LogClientStartSetCustomTextCursor,"StartSetCustomTextCursorL(id=0x%08x, flags=0x%08x, align=%d)");
       
   664 		aText.AppendFormat(LogClientStartSetCustomTextCursor, pData.CustomTextCursorData->identifier, pData.CustomTextCursorData->flags, pData.CustomTextCursorData->alignment);
       
   665 		}
       
   666 		break;
       
   667 	case EWsClOpCompleteSetCustomTextCursor:
       
   668 		{
       
   669 		_LIT(LogClientCompleteSetCustomTextCursor,"CompleteSetCustomTextCursorL(err=%d)");
       
   670 		aText.AppendFormat(LogClientCompleteSetCustomTextCursor, *pData.Int);
       
   671 		}
       
   672 		break;
       
   673 #if defined(__WINS__)
       
   674 	case EWsClOpRemoveKeyCode:
       
   675 		{
       
   676 		_LIT(LogClientRemoveKeyCode,"RemoveKeyCode(%d)");
       
   677 		aText.AppendFormat(LogClientRemoveKeyCode,*pData.UInt);
       
   678 		}
       
   679 		break;
       
   680 	case EWsClOpSimulateXyInput:
       
   681 		{
       
   682 		_LIT(LogClientSimulateXyInput,"SimulateXyInputType(%d)");
       
   683 		aText.AppendFormat(LogClientSimulateXyInput,*pData.UInt);
       
   684 		}
       
   685 		break;
       
   686 #endif
       
   687 	case EWsClOpSetBackgroundColor:
       
   688 		{		
       
   689 		TShortBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
       
   690 		_LIT(LogClientSetBackgroundColor,"SetBackgroundColor(%S)");
       
   691 		aText.AppendFormat(LogClientSetBackgroundColor,&buf);
       
   692 		}
       
   693 		break;
       
   694 	case EWsClOpGetBackgroundColor:
       
   695 		{		
       
   696 		_LIT(LogClientGetBackgroundColor,"GetBackgroundColor()");
       
   697 		aText.AppendFormat(LogClientGetBackgroundColor);
       
   698 		}
       
   699 		break;
       
   700 	case EWsClOpSystemInfo:
       
   701 		{		
       
   702 		_LIT(LogClientSystemInfo,"SystemInfo(%d, SSystemInfo &aSystemInfo)");
       
   703 		aText.AppendFormat(LogClientSystemInfo, *pData.UInt);
       
   704 		}
       
   705 		break;
       
   706 	case EWsClOpSetFocusScreen:
       
   707 		{		
       
   708 		_LIT(LogClientSetFocusScreen,"SetFocusScreen(%d)");
       
   709 		aText.AppendFormat(LogClientSetFocusScreen, *pData.UInt);
       
   710 		}
       
   711 		break;
       
   712 	case EWsClOpGetFocusScreen:
       
   713 		{		
       
   714 		_LIT(LogClientGetFocusScreen,"GetFocusScreen()");
       
   715 		aText.AppendFormat(LogClientGetFocusScreen);
       
   716 		}
       
   717 		break;
       
   718 	case EWsClOpWindowGroupListAndChain:
       
   719 		{		
       
   720 		_LIT(LogClientWindowGroupListAndChain,"WindowGroupList(%d, RArray<TWindowGroupChainInfo>* aWindowList)");
       
   721 		aText.AppendFormat(LogClientWindowGroupListAndChain, *pData.UInt);
       
   722 		}
       
   723 		break;
       
   724 	case EWsClOpWindowGroupListAndChainAllPriorities:
       
   725 		{		
       
   726 		_LIT(LogClientWindowGroupListAndChainAllPriorities,"WindowGroupListAndChainAllPriorities(RArray<TWindowGroupChainInfo>* aWindowList)");
       
   727 		aText.AppendFormat(LogClientWindowGroupListAndChainAllPriorities);
       
   728 		}
       
   729 		break;
       
   730 	case EWsClOpSetClientCursorMode:
       
   731 		{		
       
   732 		_LIT(LogClientSetClientCursorMode,"SetClientCursorMode(%d)");
       
   733 		aText.AppendFormat(LogClientSetClientCursorMode, *pData.UInt);
       
   734 		}
       
   735 		break;
       
   736 	case EWsClOpClearAllRedrawStores:
       
   737 		{		
       
   738 		_LIT(LogClientClearAllRedrawStores,"ClearAllRedrawStores()");
       
   739 		aText.AppendFormat(LogClientClearAllRedrawStores);
       
   740 		}
       
   741 		break;
       
   742 	case EWsClOpGraphicMessageReady:
       
   743 		{		
       
   744 		_LIT(LogClientGraphicMessageReady,"GraphicMessageReady(%d)");
       
   745 		aText.AppendFormat(LogClientGraphicMessageReady, *pData.UInt);	
       
   746 		}
       
   747 		break;
       
   748 	case EWsClOpGetGraphicMessage:
       
   749 		{		
       
   750 		_LIT(LogClientGraphicMessage,"GetGraphicMessage(%d)");
       
   751 		aText.AppendFormat(LogClientGraphicMessage, *pData.UInt);	
       
   752 		}
       
   753 		break;
       
   754 	case EWsClOpGraphicMessageCancel:
       
   755 		{		
       
   756 		_LIT(LogClientGraphicMessageCancel,"GraphicMessageCancel()");
       
   757 		aText.AppendFormat(LogClientGraphicMessageCancel);	
       
   758 		}
       
   759 		break;		
       
   760 	case EWsClOpNumWindowGroupsOnScreen:
       
   761 		{		
       
   762 		_LIT(LogClientNumWindowGroupsOnScreen,"NumWindowGroups(%d, %d)");
       
   763 		aText.AppendFormat(LogClientNumWindowGroupsOnScreen, pData.NumWinGroups->screenNumber, pData.NumWinGroups->priority);
       
   764 		}
       
   765 		break;
       
   766 	case EWsClOpGetNumberOfScreens:
       
   767 		{		
       
   768 		_LIT(LogClientGetNumberOfScreens,"NumberOfScreens()");
       
   769 		aText.AppendFormat(LogClientGetNumberOfScreens);		
       
   770 		}
       
   771 		break;
       
   772 	case EWsClOpNoFlickerFree:
       
   773 		{		
       
   774 		_LIT(LogNoFlickerFree,"EWsClOpNoFlickerFree enum");
       
   775 		aText.AppendFormat(LogNoFlickerFree);		
       
   776 		}
       
   777 		break;
       
   778 	case EWsClOpCreateGraphic:
       
   779 		{		
       
   780 		_LIT(LogCreateGraphic,"EWsClOpCreateGraphic enum");
       
   781 		aText.AppendFormat(LogCreateGraphic);		
       
   782 		}
       
   783 		break;
       
   784 	case EWsClOpSetCloseProximityThresholds:
       
   785 		{
       
   786 		_LIT(LogSetCloseProximityThresholds,"SetCloseProximityThresholds(%d, %d)");
       
   787 		aText.AppendFormat(LogSetCloseProximityThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold);
       
   788 		}
       
   789 		break;	
       
   790 	case EWsClOpSetHighPressureThresholds:
       
   791 		{
       
   792 		_LIT(LogSetHighPressureThresholds,"SetHighPressureThresholds(%d, %d)");
       
   793 		aText.AppendFormat(LogSetHighPressureThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold);	
       
   794 		}
       
   795 		break;
       
   796 	case EWsClOpGetEnterCloseProximityThreshold:
       
   797 		{		
       
   798 		_LIT(LogGetEnterCloseProximityThreshold,"EWsClOpGetEnterCloseProximityThreshold()");
       
   799 		aText.AppendFormat(LogGetEnterCloseProximityThreshold);		
       
   800 		}
       
   801 		break;	
       
   802 	case EWsClOpGetExitCloseProximityThreshold:
       
   803 		{		
       
   804 		_LIT(LogGetExitCloseProximityThreshold,"EWsClOpGetExitCloseProximityThreshold()");
       
   805 		aText.AppendFormat(LogGetExitCloseProximityThreshold);		
       
   806 		}
       
   807 		break;
       
   808 	case EWsClOpGetEnterHighPressureThreshold:
       
   809 		{		
       
   810 		_LIT(LogGetEnterHighPressureThreshold,"EWsClOpGetEnterHighPressureThreshold()");
       
   811 		aText.AppendFormat(LogGetEnterHighPressureThreshold);		
       
   812 		}
       
   813 		break;	
       
   814 	case EWsClOpGetExitHighPressureThreshold:
       
   815 		{		
       
   816 		_LIT(LogGetExitHighPressureThreshold,"EWsClOpGetExitHighPressureThreshold()");
       
   817 		aText.AppendFormat(LogGetExitHighPressureThreshold);		
       
   818 		}
       
   819 		break;	
       
   820 	case EWsClOpLastEnumValue:
       
   821 		{		
       
   822 		_LIT(LogLastEnumValue,"EWsClOpLastEnumValue enum");
       
   823 		aText.AppendFormat(LogLastEnumValue);		
       
   824 		}
       
   825 		break;
       
   826 	default:
       
   827 		UnKnownOpcode(aText, aOpcode);
       
   828 		break;
       
   829 		}
       
   830 	}
       
   831 
       
   832 void TWsDecoder::DecodeWindow(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
   833 	{
       
   834 	_LIT(LogWindow,"RWindow[%d]::");
       
   835 	aText.Format(LogWindow,aHandle);
       
   836 	decodeWindow(aText,aOpcode,aCmdData);
       
   837 	}
       
   838 
       
   839 void TWsDecoder::decodeWindow(TBuf<LogTBufSize> &aText,TInt aOpcode,const TAny *aData)
       
   840 	{
       
   841 	TWsWinCmdUnion pData;
       
   842 	pData.any=aData;
       
   843 	switch (aOpcode)
       
   844 		{
       
   845 	case EWsWinOpFree:
       
   846 		aText.AppendFormat(LogClose);
       
   847 		break;
       
   848 	case EWsWinOpSetExtent:
       
   849 		{
       
   850 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos));
       
   851 		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size));
       
   852 		aText.AppendFormat(_L("SetExtent(%S, %S)"), &buf1, &buf2);
       
   853 		}
       
   854 		break;
       
   855 	case EWsWinOpSetExtentErr:
       
   856 		{
       
   857 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos));
       
   858 		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size));
       
   859 		aText.AppendFormat(_L("SetExtentError(%S, %S)"), &buf1, &buf2);
       
   860 		}
       
   861 		break;
       
   862 	case EWsWinOpOrdinalPosition:
       
   863 		aText.AppendFormat(_L("OrdinalPosition()"));
       
   864 		break;
       
   865 	case EWsWinOpFullOrdinalPosition:
       
   866 		aText.AppendFormat(_L("FullOrdinalPosition()"));
       
   867 		break;
       
   868 	case EWsWinOpSetOrdinalPosition:
       
   869 		aText.AppendFormat(_L("SetOrdinalPosition(%d)"),*pData.Int);
       
   870 		break;
       
   871 	case EWsWinOpSetOrdinalPositionPri:
       
   872 		aText.AppendFormat(_L("SetOrdinalPosition(%d,%d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority);
       
   873 		break;
       
   874 	case EWsWinOpSetPos:
       
   875 		{
       
   876 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.pos));
       
   877 		aText.AppendFormat(_L("SetPosition(%S)"),&buf);
       
   878 		}
       
   879 		break;
       
   880 	case EWsWinOpSetSizeErr:
       
   881 		{
       
   882 		TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size));
       
   883 		aText.AppendFormat(_L("SetSizeErr(%S)"), &buf);
       
   884 		}
       
   885 		break;
       
   886 	case EWsWinOpSetSize:
       
   887 		{
       
   888 		TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size));
       
   889 		aText.AppendFormat(_L("SetSize(%S)"), &buf);
       
   890 		}
       
   891 		break;
       
   892 	case EWsWinOpPosition:
       
   893 		aText.AppendFormat(_L("Position()"));
       
   894 		break;
       
   895 	case EWsWinOpAbsPosition:
       
   896 		aText.AppendFormat(_L("AbsPosition()"));
       
   897 		break;
       
   898 	case EWsWinOpSize:
       
   899 		aText.AppendFormat(_L("Size()"));
       
   900 		break;
       
   901 	case EWsWinOpActivate:
       
   902 		aText.AppendFormat(_L("Activate()"));
       
   903 		break;
       
   904 	case EWsWinOpInvalidate:
       
   905 		{
       
   906 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect));
       
   907 		aText.AppendFormat(_L("Invalidate(%S)"), &buf);
       
   908 		}
       
   909 		break;
       
   910 	case EWsWinOpInvalidateFull:
       
   911 		aText.AppendFormat(_L("Invalidate()"));
       
   912 		break;
       
   913 	case EWsWinOpBeginRedraw:
       
   914 		{
       
   915 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect));
       
   916 		aText.AppendFormat(_L("BeginRedraw(%S)"), &buf);
       
   917 		}
       
   918 		break;
       
   919 	case EWsWinOpBeginRedrawFull:
       
   920 		aText.AppendFormat(_L("BeginRedraw()"));
       
   921 		break;
       
   922 	case EWsWinOpEndRedraw:
       
   923 		aText.AppendFormat(_L("EndRedraw()"));
       
   924 		break;
       
   925 	case EWsWinOpTestInvariant:
       
   926 		aText.AppendFormat(_L("__TestInvariant()"));
       
   927 		break;
       
   928 	case EWsWinOpParent:
       
   929 		aText.AppendFormat(_L("Parent()"));
       
   930 		break;
       
   931 	case EWsWinOpNextSibling:
       
   932 		aText.AppendFormat(_L("NextSibling()"));
       
   933 		break;
       
   934 	case EWsWinOpPrevSibling:
       
   935 		aText.AppendFormat(_L("PrevSibling()"));
       
   936 		break;
       
   937 	case EWsWinOpChild:
       
   938 		aText.AppendFormat(_L("Child()"));
       
   939 		break;
       
   940 	case EWsWinOpInquireOffset:
       
   941 		aText.AppendFormat(_L("InquireOffset(%d)"),hHandleToValue(*pData.UInt));
       
   942 		break;
       
   943 	case EWsWinOpPointerFilter:
       
   944 		aText.AppendFormat(_L("PointerFilter(0x%08x)"), *pData.UInt);
       
   945 		break;
       
   946 	case EWsWinOpSetPointerCapture:
       
   947 		aText.AppendFormat(_L("SetPointerCapture(%u)"), *pData.UInt);
       
   948 		break;
       
   949 	case EWsWinOpSetPointerGrab:
       
   950 		aText.AppendFormat(_L("SetPointerGrab(%u)"), *pData.UInt);
       
   951 		break;
       
   952 	case EWsWinOpSetNoBackgroundColor:
       
   953 		aText.Append(_L("SetBackgroundColor()"));
       
   954 		break;
       
   955 	case EWsWinOpSetBackgroundColor:
       
   956 		{
       
   957 		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
       
   958 		aText.AppendFormat(_L("SetBackgroundColor(%S)"), &buf);
       
   959 		}
       
   960 		break;
       
   961 	case EWsWinOpSetColor:
       
   962 		{
       
   963 		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
       
   964 		aText.AppendFormat(_L("SetColor(%S)"), &buf);
       
   965 		}
       
   966 		break;
       
   967 	case EWsWinOpSetShadowHeight:
       
   968 		aText.AppendFormat(_L("SetShadowHeight(%d)"), *pData.Int);
       
   969 		break;
       
   970 	case EWsWinOpShadowDisabled:
       
   971 		{
       
   972 		TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool));
       
   973 		aText.AppendFormat(_L("SetShadowDisabled(%S)"), &buf);
       
   974 		}
       
   975 		break;
       
   976 	case EWsWinOpSetVisible:
       
   977 		{
       
   978 		TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool));
       
   979 		aText.AppendFormat(_L("SetVisible(%S)"), &buf);
       
   980 		}
       
   981 		break;
       
   982 	case EWsWinOpUpdateScreen:
       
   983 		aText.Append(_L("UpdateScreen()"));
       
   984 		break;
       
   985 	case EWsWinOpUpdateScreenRegion:
       
   986 		aText.Append(_L("UpdateScreenRegion(TRegion(...))"));
       
   987 		break;
       
   988 	case EWsWinOpMaintainBackup:
       
   989 		aText.Append(_L("MaintainBackup()"));
       
   990 		break;
       
   991 	case EWsWinOpGetInvalidRegion:
       
   992 		aText.Append(_L("GetInvalidRegion(...)"));
       
   993 		break;
       
   994 	case EWsWinOpGetInvalidRegionCount:
       
   995 		aText.Append(_L("GetInvalidRegionCount()"));
       
   996 		break;
       
   997 	case EWsWinOpScroll:
       
   998 		{
       
   999 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
       
  1000 		aText.AppendFormat(_L("Scroll(%S)"), &buf);
       
  1001 		}
       
  1002 		break;
       
  1003 	case EWsWinOpScrollClip:
       
  1004 		{
       
  1005 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip));
       
  1006 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
       
  1007 		aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2);
       
  1008 		}
       
  1009 		break;
       
  1010 	case EWsWinOpScrollRect:
       
  1011 		{
       
  1012 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
       
  1013 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect));
       
  1014 		aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2);
       
  1015 		}
       
  1016 		break;
       
  1017 	case EWsWinOpScrollClipRect:
       
  1018 		{
       
  1019 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip));
       
  1020 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset));
       
  1021 		TLongBuf buf3(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect));
       
  1022 		aText.AppendFormat(_L("Scroll(%S, %S, %S)"), &buf1, &buf2, &buf3);
       
  1023 		}
       
  1024 		break;
       
  1025 	case EWsWinOpBitmapHandle:
       
  1026 		aText.Append(_L("BitmapHandle()"));
       
  1027 		break;
       
  1028 	case EWsWinOpUpdateBackupBitmap:
       
  1029 		aText.Append(_L("UpdateBackupBitmap()"));
       
  1030 		break;
       
  1031 	case EWsWinOpRequiredDisplayMode:
       
  1032 		aText.AppendFormat(_L("SetRequiredDisplayMode(%d)"), *pData.UInt);
       
  1033 		break;
       
  1034 	case EWsWinOpSetCornerType:
       
  1035 		aText.AppendFormat(_L("SetCornerType(%d)"), *pData.UInt);
       
  1036 		break;
       
  1037 	case EWsWinOpSetShape:
       
  1038 		aText.AppendFormat(_L("SetWindowShape(%d rects)"), pData.SetShape->count);
       
  1039 		break;
       
  1040 	case EWsWinOpSetName:
       
  1041 		aText.Append(_L("SetName(\"...\")"));
       
  1042 		break;
       
  1043 	case EWsWinOpName:
       
  1044 		aText.Append(_L("Name()"));
       
  1045 		break;
       
  1046 	case EWsWinOpSetOwningWindowGroup:
       
  1047 		aText.AppendFormat(_L("SetOwningWindowGroup(%d)"),*pData.Int);
       
  1048 		break;
       
  1049 	case EWsWinOpDefaultOwningWindow:
       
  1050 		aText.Append(_L("DefaultOwningWindow()"));
       
  1051 		break;
       
  1052 	case EWsWinOpEnableOnEvents:
       
  1053 		aText.AppendFormat(_L("EnableOnEvents(%d)"),*pData.Int);
       
  1054 		break;
       
  1055 	case EWsWinOpDisableOnEvents:
       
  1056 		aText.Append(_L("DisableOnEvents()"));
       
  1057 		break;
       
  1058 	case EWsWinOpEnableErrorMessages:
       
  1059 		aText.AppendFormat(_L("EnableErrorMessages(%d)"),*pData.Int);
       
  1060 		break;
       
  1061 	case EWsWinOpDisableErrorMessages:
       
  1062 		aText.Append(_L("DisableErrorMessages()"));
       
  1063 		break;
       
  1064 	case EWsWinOpEnableModifierChangedEvents:
       
  1065 		aText.Append(_L("EnableModifierChangedEvents()"));
       
  1066 		break;
       
  1067 	case EWsWinOpDisableModifierChangedEvents:
       
  1068 		aText.Append(_L("DisableModifierChangedEvents()"));
       
  1069 		break;
       
  1070 	case EWsWinOpEnableGroupChangeEvents:
       
  1071 		aText.Append(_L("EnableGroupChangeEvents()"));
       
  1072 		break;
       
  1073 	case EWsWinOpDisableGroupChangeEvents:
       
  1074 		aText.Append(_L("DisableGroupChangeEvents()"));
       
  1075 		break;
       
  1076 	case EWsWinOpRequestPointerRepeatEvent:
       
  1077 		{
       
  1078 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.RequestPointerRepeatEvent->rect));
       
  1079 		aText.AppendFormat(_L("RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(%d), %S)"), 
       
  1080 								pData.RequestPointerRepeatEvent->time.Int(), &buf);
       
  1081 		}
       
  1082 		break;
       
  1083 	case EWsWinOpCancelPointerRepeatEventRequest:
       
  1084 		aText.Append(_L("CancelPointerRepeatEventRequest()"));
       
  1085 		break;
       
  1086 	case EWsWinOpSetPointerCursor:
       
  1087 		aText.AppendFormat(_L("SetPointerCursor(%d)"),*pData.UInt);
       
  1088 		break;
       
  1089 	case EWsWinOpSetCustomPointerCursor:
       
  1090 		aText.AppendFormat(_L("SetCustomPointerCursor(%d)"),*pData.UInt);
       
  1091 		break;
       
  1092 	case EWsWinOpPasswordWindow:
       
  1093 		aText.AppendFormat(_L("PasswordWindow(%d)"),*pData.PasswordMode);
       
  1094 		break;
       
  1095 	case EWsWinOpAddKeyRect:
       
  1096 		{
       
  1097 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.AddKeyRect->rect));
       
  1098 		aText.AppendFormat(_L("AddKeyRect(%S,%d,%d)"),&buf,pData.AddKeyRect->scanCode,pData.AddKeyRect->activatedByPointerSwitchOn);
       
  1099 		}
       
  1100 		break;
       
  1101 	case EWsWinOpRemoveAllKeyRects:
       
  1102 		aText.Append(_L("RemoveAllKeyRects()"));
       
  1103 		break;
       
  1104 	case EWsWinOpAllocPointerMoveBuffer:
       
  1105 		aText.AppendFormat(_L("AllocPointerMoveBuffer(%d,%d)"),pData.AllocPointerMoveBuffer->maxNumPoints,pData.AllocPointerMoveBuffer->flags);
       
  1106 		break;
       
  1107 	case EWsWinOpFreePointerMoveBuffer:
       
  1108 		aText.Append(_L("FreePointerMoveBuffer()"));
       
  1109 		break;
       
  1110 	case EWsWinOpEnablePointerMoveBuffer:
       
  1111 		aText.Append(_L("EnablePointerMoveBuffer()"));
       
  1112 		break;
       
  1113 	case EWsWinOpDisablePointerMoveBuffer:
       
  1114 		aText.Append(_L("DisablePointerMoveBuffer()"));
       
  1115 		break;
       
  1116 	case EWsWinOpRetrievePointerMoveBuffer:
       
  1117 		aText.Append(_L("RetrievePointerMoveBuffer(...)"));
       
  1118 		break;
       
  1119 	case EWsWinOpDiscardPointerMoveBuffer:
       
  1120 		aText.Append(_L("DiscardPointerMoveBuffer()"));
       
  1121 		break;
       
  1122 	case EWsWinOpEnableBackup:
       
  1123 		aText.Append(_L("EnableBackup()"));
       
  1124 		break;
       
  1125 	case EWsWinOpClaimPointerGrab:
       
  1126 		aText.Append(_L("ClaimPointerGrab()"));
       
  1127 		break;
       
  1128 	case EWsWinOpIdentifier:
       
  1129 		aText.Append(_L("Identifier()"));
       
  1130 		break;
       
  1131 	case EWsWinOpSetFade:
       
  1132 		{
       
  1133 		_LIT(LogWinSetFade,"SetFade(%d,%d");
       
  1134 		aText.AppendFormat(LogWinSetFade,pData.SetFaded->Faded(),pData.SetFaded->IncludeChildren());
       
  1135 		if (!pData.SetFaded->UseDefaultMap())
       
  1136 			{
       
  1137 			_LIT(LogWinSetFade2,",%d,%d");
       
  1138 			TUint8 blackMap;
       
  1139 			TUint8 whiteMap;
       
  1140 			pData.SetFaded->GetFadingParams(blackMap,whiteMap);
       
  1141 			aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap);
       
  1142 			}
       
  1143 		aText.Append(LogCloseBracket);
       
  1144 		}
       
  1145 		break;
       
  1146 	case EWsWinOpSetNonFading:
       
  1147 		{
       
  1148 		_LIT(LogWinSetNonFading,"SetNonFading(%d)");
       
  1149 		aText.AppendFormat(LogWinSetNonFading,*(pData.Bool));
       
  1150 		}
       
  1151 		break;
       
  1152 	case EWsWinOpFadeBehind:
       
  1153 		{
       
  1154 		_LIT(LogWinFadeBehind,"FadeBehind(%d)");
       
  1155 		aText.AppendFormat(LogWinFadeBehind,*(pData.Bool));
       
  1156 		}
       
  1157 		break;
       
  1158 	case EWsWinOpEnableScreenChangeEvents:
       
  1159 		{
       
  1160 		_LIT(LogWinEnableScreenChangeEvents,"EnableScreenChangeEvents()");
       
  1161 		aText.Append(LogWinEnableScreenChangeEvents);
       
  1162 		}
       
  1163 		break;
       
  1164 	case EWsWinOpDisableScreenChangeEvents:
       
  1165 		{
       
  1166 		_LIT(LogWinDisableScreenChangeEvents,"DisableScreenChangeEvents()");
       
  1167 		aText.Append(LogWinDisableScreenChangeEvents);
       
  1168 		}
       
  1169 		break;
       
  1170 	case EWsWinOpSendPointerEvent:
       
  1171 		{
       
  1172 		_LIT(LogWinSendPointerEvent,"SimulatePointerEvent(");
       
  1173 		aText.Append(LogWinSendPointerEvent);
       
  1174 		aText.Append(eventDetails(pData.RawEvent));
       
  1175 		aText.Append(LogCloseBracket);
       
  1176 		}
       
  1177 		break;
       
  1178 	case EWsWinOpSendAdvancedPointerEvent:
       
  1179 		{
       
  1180 		_LIT(LogWinSendPointerEvent,"SimulateAdvancedPointerEvent(");
       
  1181 		aText.Append(LogWinSendPointerEvent);
       
  1182 		aText.Append(eventDetails(pData.RawEvent));
       
  1183 		aText.Append(LogCloseBracket);
       
  1184 		}
       
  1185 		break;
       
  1186 	case EWsWinOpGetDisplayMode:
       
  1187 		{
       
  1188 		_LIT(LogWinGetDisplayMode,"GetDisplayMode()");
       
  1189 		aText.Append(LogWinGetDisplayMode);
       
  1190 		}
       
  1191 		break;
       
  1192 	case EWsWinOpGetIsFaded:
       
  1193 		{
       
  1194 		_LIT(LogWinIsFaded,"IsFaded()");
       
  1195 		aText.Append(LogWinIsFaded);
       
  1196 		}
       
  1197 		break;
       
  1198 	case EWsWinOpGetIsNonFading:
       
  1199 		{
       
  1200 		_LIT(LogWinIsNonFading,"IsNonFading()");
       
  1201 		aText.Append(LogWinIsNonFading);
       
  1202 		}
       
  1203 		break;
       
  1204 	case EWsWinOpOrdinalPriority:
       
  1205 		{
       
  1206 		_LIT(LogWinOrdinalPriority,"OrdinalPriority()");
       
  1207 		aText.Append(LogWinOrdinalPriority);
       
  1208 		}
       
  1209 		break;
       
  1210 	case EWsWinOpClearPointerCursor:
       
  1211 		{
       
  1212 		_LIT(LogWinClearPointerCursor,"ClearPointerCursor()");
       
  1213 		aText.Append(LogWinClearPointerCursor);
       
  1214 		}
       
  1215 		break;
       
  1216 	case EWsWinOpEnableGroupListChangeEvents:
       
  1217 		{
       
  1218 		_LIT(LogWinEnableGroupListChangeEvents,"EnableGroupListChangeEvents()");
       
  1219 		aText.Append(LogWinEnableGroupListChangeEvents);
       
  1220 		}
       
  1221 		break;
       
  1222 	case EWsWinOpDisableGroupListChangeEvents:
       
  1223 		{
       
  1224 		_LIT(LogWinDisableGroupListChangeEvents,"DisableGroupListChangeEvents()");
       
  1225 		aText.Append(LogWinDisableGroupListChangeEvents);
       
  1226 		}
       
  1227 		break;
       
  1228 	case EWsWinOpHandleTransparencyUpdate:
       
  1229 		{
       
  1230 		_LIT(LogWinHandleTransparencyUpdate,"HandleTransparencyUpdate()");
       
  1231 		aText.Append(LogWinHandleTransparencyUpdate);
       
  1232 		}
       
  1233 		break;
       
  1234 	case EWsWinOpSetTransparencyFactor:
       
  1235 		{
       
  1236 		_LIT(LogWinSetTransparencyFactor,"SetTransparencyFactor()");
       
  1237 		aText.Append(LogWinSetTransparencyFactor);
       
  1238 		}
       
  1239 		break;
       
  1240 	case EWsWinOpSetTransparencyBitmap:
       
  1241 		{
       
  1242 		_LIT(LogWinSetTransparencyBitmap,"SetTransparencyBitmap()");
       
  1243 		aText.Append(LogWinSetTransparencyBitmap);
       
  1244 		}
       
  1245 		break;
       
  1246 	case EWsWinOpSetTransparencyBitmapCWs:
       
  1247 		{
       
  1248 		_LIT(LogWinSetTransparencyWsBitmap,"SetTransparencyWsBitmap()");
       
  1249 		aText.Append(LogWinSetTransparencyWsBitmap);
       
  1250 		}
       
  1251 		break;	
       
  1252 
       
  1253 	case EWsWinOpSetTransparencyAlphaChannel:
       
  1254 		{
       
  1255 		_LIT(LogWinSetTransparencyAlphaChannel,"SetTransparencyAlphaChannel()");
       
  1256 		aText.Append(LogWinSetTransparencyAlphaChannel);
       
  1257 		}
       
  1258 		break;	
       
  1259 	case EWsWinOpMoveToGroup:
       
  1260 		{
       
  1261 		_LIT(LogWinMoveToGroup,"MoveToGroup(%d)");
       
  1262 		aText.AppendFormat(LogWinMoveToGroup, pData.Int);
       
  1263 		}
       
  1264 		break;	
       
  1265 	case EWsWinOpStoreDrawCommands:
       
  1266 		{
       
  1267 		_LIT(LogWinStoreDrawCommands,"EnableRedrawStore(%u)");
       
  1268 		aText.AppendFormat(LogWinStoreDrawCommands, pData.Bool);
       
  1269 		}
       
  1270 		break;	
       
  1271 	case EWsWinOpSetPointerCapturePriority:
       
  1272 		{
       
  1273 		_LIT(LogWinSetPointerCapturePriority,"SetPointerCapturePriority(%d)");
       
  1274 		aText.AppendFormat(LogWinSetPointerCapturePriority, pData.Int);
       
  1275 		}
       
  1276 		break;	
       
  1277 	case EWsWinOpGetPointerCapturePriority:
       
  1278 		{
       
  1279 		_LIT(LogWinGetPointerCapturePriority,"GetPointerCapturePriority()");
       
  1280 		aText.Append(LogWinGetPointerCapturePriority);
       
  1281 		}
       
  1282 		break;	
       
  1283 	case EWsWinOpSetTransparentRegion:
       
  1284 		{
       
  1285 		_LIT(LogWinSetTransparentRegion,"SetTransparentRegion(%d rects)");
       
  1286 		aText.AppendFormat(LogWinSetTransparentRegion, pData.SetShape->count);
       
  1287 		}
       
  1288 		break;	
       
  1289 	case EWsWinOpSetTransparencyPolicy:
       
  1290 		{
       
  1291 		_LIT(LogWinSetTransparentPolicy,"SetTransparencyPolicy(TransparencyPolicy= %d)");
       
  1292 		aText.AppendFormat(LogWinSetTransparentPolicy, pData.Int);
       
  1293 		}
       
  1294 		break;	
       
  1295 	case EWsWinOpIsRedrawStoreEnabled:
       
  1296 		{
       
  1297 		_LIT(LogWinIsRedrawStoreEnabled,"IsRedrawStoreEnabled()");
       
  1298 		aText.Append(LogWinIsRedrawStoreEnabled);
       
  1299 		}
       
  1300 		break;		
       
  1301 	case EWsWinOpEnableOSB:
       
  1302 		{
       
  1303 		_LIT(LogOSBEnabled,"EWsWinOpEnableOSB enum");
       
  1304 		aText.Append(LogOSBEnabled);
       
  1305 		}
       
  1306 		break;		
       
  1307 	case EWsWinOpDisableOSB:
       
  1308 		{
       
  1309 		_LIT(LogOSBDisabled,"EWsWinOpDisableOSB enum");
       
  1310 		aText.Append(LogOSBDisabled);
       
  1311 		}
       
  1312 		break;
       
  1313 	case EWsWinOpClientHandle:
       
  1314 		{
       
  1315 		_LIT(LogClientHandle,"ClientHandle()");
       
  1316 		aText.AppendFormat(LogClientHandle);
       
  1317 		}
       
  1318 		break;
       
  1319 	default:
       
  1320 		UnKnownOpcode(aText, aOpcode);
       
  1321 		break;
       
  1322 		}
       
  1323 	}
       
  1324 
       
  1325 //#pragma check_stack(on)
       
  1326 void TWsDecoder::DecodeGc(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  1327 	{
       
  1328 	_LIT(LogGc,"RGc[%d]::");
       
  1329 	aText.Format(LogGc,aHandle);
       
  1330     if (aOpcode<EWsGcOpGdiBlt2)
       
  1331         {
       
  1332         if (aOpcode<EWsGcOpDrawPolyLineContinued)
       
  1333             DecodeGc1(aText,aOpcode,aCmdData);
       
  1334         else
       
  1335             DecodeGc2(aText,aOpcode,aCmdData);
       
  1336         }
       
  1337     else
       
  1338         DecodeGc3(aText,aOpcode,aCmdData);
       
  1339     }
       
  1340     
       
  1341 void TWsDecoder::DecodeGc1(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
       
  1342 	{
       
  1343 	TWsGcCmdUnion pData;
       
  1344 
       
  1345 	pData.any=aCmdData;
       
  1346 	switch (aOpcode)
       
  1347 		{
       
  1348 	case EWsGcOpFree:
       
  1349 		aText.AppendFormat(LogClose);
       
  1350 		break;
       
  1351 	case EWsGcOpActivate:
       
  1352 		{
       
  1353 		_LIT(LogGcActivate,"Activate(%d)");
       
  1354 		aText.AppendFormat(LogGcActivate,hHandleToValue(*pData.UInt));
       
  1355 		}
       
  1356 		break;
       
  1357 	case EWsGcOpDeactivate:
       
  1358 		{
       
  1359 		_LIT(LogGcDeactivate,"Deactivate()");
       
  1360 		aText.AppendFormat(LogGcDeactivate);
       
  1361 		}
       
  1362 		break;
       
  1363 	case EWsGcOpDrawLine:
       
  1364 		{
       
  1365 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt1));
       
  1366 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt2));
       
  1367 		_LIT(LogGcDrawLine,"DrawLine(%S, %S)");
       
  1368 		aText.AppendFormat(LogGcDrawLine, &buf1, &buf2);
       
  1369 		}
       
  1370 		break;
       
  1371 	case EWsGcOpSetBrushStyle:
       
  1372 		{
       
  1373 		_LIT(LogGcSetBrushStyle,"SetBrushStyle(%u)");
       
  1374 		aText.AppendFormat(LogGcSetBrushStyle,*pData.UInt);
       
  1375 		}
       
  1376 		break;
       
  1377 	case EWsGcOpPlot:
       
  1378 		{
       
  1379 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1380 		_LIT(LogGcPlot,"Plot(%S)");
       
  1381 		aText.AppendFormat(LogGcPlot, &buf);
       
  1382 		}
       
  1383 		break;
       
  1384 	case EWsGcOpSetPenColor:
       
  1385 		{
       
  1386 		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
       
  1387 		_LIT(LogGcSetPenColor,"SetPenColor(%S)");
       
  1388 		aText.AppendFormat(LogGcSetPenColor,&buf);
       
  1389 		}
       
  1390 		break;
       
  1391 	case EWsGcOpSetBrushColor:
       
  1392 		{
       
  1393 		TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb));
       
  1394 		_LIT(LogGcSetBrushColor,"SetBrushColor(%S)");
       
  1395 		aText.AppendFormat(LogGcSetBrushColor,&buf);
       
  1396 		}
       
  1397 		break;
       
  1398 	case EWsGcOpSetPenSize:
       
  1399 		{
       
  1400 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1401 		_LIT(LogGcSetPenSize,"SetPenSize(%S)");
       
  1402 		aText.AppendFormat(LogGcSetPenSize,&buf);
       
  1403 		}
       
  1404 		break;
       
  1405 	case EWsGcOpSetPenStyle:
       
  1406 		{
       
  1407 		_LIT(LogGcSetPenStyle,"SetPenStyle(%d)");
       
  1408 		aText.AppendFormat(LogGcSetPenStyle,*pData.UInt);
       
  1409 		}
       
  1410 		break;
       
  1411 	case EWsGcOpSetClippingRegion:
       
  1412 		{
       
  1413 		_LIT(LogGcSetClippingRegion,"SetClippingRegion(...)");
       
  1414 		aText.Append(LogGcSetClippingRegion);
       
  1415 		}
       
  1416 		break;
       
  1417 	case EWsGcOpCancelClippingRegion:
       
  1418 		{
       
  1419 		_LIT(LogGcCancelClippingRegion,"CancelClippingRegion()");
       
  1420 		aText.Append(LogGcCancelClippingRegion);
       
  1421 		}
       
  1422 		break;
       
  1423 	case EWsGcOpSetClippingRect:
       
  1424 		{
       
  1425 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
       
  1426 		_LIT(LogGcSetClippingRect,"SetClippingRect(%S)");
       
  1427 		aText.AppendFormat(LogGcSetClippingRect,&buf);
       
  1428 		}
       
  1429 		break;
       
  1430 	case EWsGcOpCancelClippingRect:
       
  1431 		{
       
  1432 		_LIT(LogGcCancelClippingRect,"CancelClippingRect()");
       
  1433 		aText.Append(LogGcCancelClippingRect);
       
  1434 		}
       
  1435 		break;
       
  1436 	case EWsGcOpDrawTo:
       
  1437 		{
       
  1438 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1439 		_LIT(LogGcDrawTo,"DrawTo(%S)");
       
  1440 		aText.AppendFormat(LogGcDrawTo,&buf);
       
  1441 		}
       
  1442 		break;
       
  1443 	case EWsGcOpDrawBy:
       
  1444 		{
       
  1445 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1446 		_LIT(LogGcDrawBy,"DrawBy(%S)");
       
  1447 		aText.AppendFormat(LogGcDrawBy,&buf);
       
  1448 		}
       
  1449 		break;
       
  1450 	case EWsGcOpDrawPolyLine:
       
  1451 		{
       
  1452 		_LIT(LogGcDrawPolyLine,"DrawPolyLine(%d...)");
       
  1453 		aText.AppendFormat(LogGcDrawPolyLine,pData.PolyLine->numPoints);
       
  1454 		}
       
  1455 		break;
       
  1456 	case EWsGcOpDrawPolyLineContinued:
       
  1457 		{
       
  1458 		_LIT(LogGcDrawPolyLineContinued,"DrawPolyLineContinued(%d...)");
       
  1459 		aText.AppendFormat(LogGcDrawPolyLineContinued,pData.PolyLine->numPoints);
       
  1460 		}
       
  1461 		break;
       
  1462 	case EWsGcOpUseBrushPattern:
       
  1463 		{
       
  1464 		_LIT(LogGcUseBrushPattern,"UseBrushPattern({0x%x})");
       
  1465 		aText.AppendFormat(LogGcUseBrushPattern,hHandleToValue(*pData.handle));
       
  1466 		}
       
  1467 		break;
       
  1468 	case EWsGcOpDrawArc:
       
  1469 		{
       
  1470 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect));
       
  1471 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start));
       
  1472 		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end));
       
  1473 		_LIT(LogGcDrawArc,"DrawArc(%S,%S,%S)");
       
  1474 		aText.AppendFormat(LogGcDrawArc,&buf1,&buf2,&buf3);
       
  1475 		}
       
  1476 		break;
       
  1477 	case EWsGcOpSetWordJustification:
       
  1478 		{
       
  1479 		_LIT(LogGcSetWordJustification,"SetWordJustification(%d,%d)");
       
  1480 		aText.AppendFormat(LogGcSetWordJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps);
       
  1481 		}
       
  1482 		break;
       
  1483 	case EWsGcOpSetCharJustification:
       
  1484 		{
       
  1485 		_LIT(LogGcSetCharJustification,"SetCharJustification(%d,%d)");
       
  1486 		aText.AppendFormat(LogGcSetCharJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps);
       
  1487 		}
       
  1488 		break;
       
  1489 	case EWsGcOpSetBrushOrigin:
       
  1490 		{
       
  1491 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1492 		aText.AppendFormat(_L("SetBrushOrigin(%S)"), &buf);		
       
  1493 		}
       
  1494 		break;
       
  1495 	case EWsGcOpDiscardBrushPattern:
       
  1496 		{
       
  1497 		_LIT(LogGcDiscardBrushPattern,"DiscardBrushPattern()");
       
  1498 		aText.Append(LogGcDiscardBrushPattern);
       
  1499 		}	
       
  1500 		break;	
       
  1501  	default:
       
  1502 		UnKnownOpcode(aText, aOpcode);
       
  1503 		break;
       
  1504 		}
       
  1505 	}
       
  1506 
       
  1507 void TWsDecoder::DecodeGc2(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
       
  1508 	{
       
  1509 	TWsGcCmdUnion pData;
       
  1510 
       
  1511 	pData.any=aCmdData;
       
  1512 	switch (aOpcode)
       
  1513 		{
       
  1514 	case EWsGcOpDrawText:
       
  1515 		{
       
  1516 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos));
       
  1517 		_LIT(LogGcDrawText1,"DrawText(\"");
       
  1518 		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
       
  1519 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawText+1), pData.DrawText->length));
       
  1520 		_LIT(LogGcDrawText2,"\", %S)");
       
  1521 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf);
       
  1522 		}
       
  1523 		break;
       
  1524 	case EWsGcOpDrawTextVertical:
       
  1525 		{
       
  1526 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos));
       
  1527 		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(\"");
       
  1528 		TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1);
       
  1529 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawTextVertical+1), pData.DrawTextVertical->length));
       
  1530 		_LIT(LogGcDrawTextVertical2,"\", %S, %d)");
       
  1531 		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up);
       
  1532 		}
       
  1533 		break;
       
  1534 	case EWsGcOpDrawTextVerticalPtr:
       
  1535 		{
       
  1536 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos));
       
  1537 		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(...");
       
  1538 		TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1);
       
  1539 		_LIT(LogGcDrawTextVertical2,", %S, %d)");
       
  1540 		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up);
       
  1541 		}
       
  1542 		break;
       
  1543 	case EWsGcOpDrawTextPtr:
       
  1544 		{
       
  1545 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos));
       
  1546 		_LIT(LogGcDrawText1,"DrawText(...");
       
  1547 		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
       
  1548 		_LIT(LogGcDrawText2,",%S)");
       
  1549 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf);
       
  1550 		}
       
  1551 		break;
       
  1552 	case EWsGcOpDrawBoxTextOptimised1:
       
  1553 		{
       
  1554 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO1->box));
       
  1555 		_LIT(LogGcDrawText1,"DrawText(\"");
       
  1556 		aText.Append(LogGcDrawText1);
       
  1557 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO1+1), pData.BoxTextO1->length));
       
  1558 		_LIT(LogGcDrawText2,"\", %S, %d, %d, 0)");
       
  1559 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf,
       
  1560 										pData.BoxTextO1->baselineOffset,CGraphicsContext::ELeft);
       
  1561 		}
       
  1562 		break;
       
  1563 	case EWsGcOpDrawBoxTextOptimised2:
       
  1564 		{
       
  1565 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO2->box));
       
  1566 		_LIT(LogGcDrawText1,"DrawText(\"");
       
  1567 		aText.Append(LogGcDrawText1);
       
  1568 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO2+1), pData.BoxTextO2->length));
       
  1569 		_LIT(LogGcDrawText2,"\", %S, %d, %d, %d)");
       
  1570 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxTextO2->baselineOffset, 
       
  1571 										pData.BoxTextO2->horiz, pData.BoxTextO2->leftMrg);
       
  1572 		}
       
  1573 		break;
       
  1574 	case EWsGcOpDrawBoxTextVertical:
       
  1575 		{
       
  1576 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box));
       
  1577 		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(\"");
       
  1578 		aText.Append(LogGcDrawTextVertical1);
       
  1579 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawBoxTextVertical+1), pData.DrawBoxTextVertical->length));
       
  1580 		_LIT(LogGcDrawTextVertical2,"\", %S, %d, %d, %d, %d)");
       
  1581 		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler, &buf,
       
  1582 										pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up,
       
  1583 										pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin);
       
  1584 		}
       
  1585 		break;
       
  1586 	case EWsGcOpDrawBoxTextPtr:
       
  1587 		{
       
  1588 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box));
       
  1589 		_LIT(LogGcDrawText1,"DrawText(...");
       
  1590 		TDebugLogTextHandler::Append(aText, LogGcDrawText1);
       
  1591 		_LIT(LogGcDrawText2,", %S, %d, %d, %d)");
       
  1592 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset,
       
  1593 										pData.BoxText->horiz, pData.BoxText->leftMrg);
       
  1594 		}
       
  1595 		break;
       
  1596 	case EWsGcOpDrawBoxTextVerticalPtr:
       
  1597 		{
       
  1598 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box));
       
  1599 		_LIT(LogGcDrawTextVertical1,"DrawTextVertical(...");
       
  1600 		aText.Append(LogGcDrawTextVertical1);
       
  1601 		_LIT(LogGcDrawTextVertical2,", %S, %d, %d, %d, %d)");
       
  1602 		aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,
       
  1603 										pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up,
       
  1604 										pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin);
       
  1605 		}
       
  1606 		break;
       
  1607 	case EWsGcOpCopyRect:
       
  1608 		{
       
  1609 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.CopyRect->pos));
       
  1610 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.CopyRect->rect));
       
  1611 		_LIT(LogGcCopyRect,"CopyRect(%S, %S)");
       
  1612 		aText.AppendFormat(LogGcCopyRect,&buf1,&buf2);
       
  1613 		}
       
  1614 		break;
       
  1615 	case EWsGcOpDrawEllipse:
       
  1616 		{
       
  1617 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
       
  1618 		_LIT(LogGcDrawEllipse,"DrawEllipse(%S)");
       
  1619 		aText.AppendFormat(LogGcDrawEllipse,&buf);
       
  1620 		}
       
  1621 		break;
       
  1622 	case EWsGcOpMoveTo:
       
  1623 		{
       
  1624 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1625 		_LIT(LogGcMoveTo,"MoveTo(%S)");
       
  1626 		aText.AppendFormat(LogGcMoveTo,&buf);
       
  1627 		}
       
  1628 		break;
       
  1629 	case EWsGcOpMoveBy:
       
  1630 		{
       
  1631 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1632 		_LIT(LogGcMoveBy,"MoveBy(%S)");
       
  1633 		aText.AppendFormat(LogGcMoveBy,&buf);
       
  1634 		}
       
  1635 		break;
       
  1636 	case EWsGcOpDrawPolygon:
       
  1637 		{
       
  1638 		_LIT(LogGcDrawPolygon,"DrawPolygon(...)");
       
  1639 		aText.Append(LogGcDrawPolygon);
       
  1640 		}
       
  1641 		break;
       
  1642 	case EWsGcOpDrawRoundRect:
       
  1643 		{
       
  1644 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RoundRect->rect));
       
  1645 		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.RoundRect->ellipse));
       
  1646 		_LIT(LogGcDrawRoundRect,"DrawRoundRect(%S,%S)");
       
  1647 		aText.AppendFormat(LogGcDrawRoundRect,&buf1,&buf2);
       
  1648 		}
       
  1649 		break;
       
  1650 	case EWsGcOpDrawPie:
       
  1651 		{
       
  1652 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect));
       
  1653 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start));
       
  1654 		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end));
       
  1655 		_LIT(LogGcDrawPie,"DrawPie(%S,%S,%S)");
       
  1656 		aText.AppendFormat(LogGcDrawPie,&buf1,&buf2,&buf3);
       
  1657 		}
       
  1658 		break;
       
  1659 	case EWsGcOpSetOrigin:
       
  1660 		{
       
  1661 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1662 		_LIT(LogGcSetOrigin,"SetOrigin(%S)");
       
  1663 		aText.AppendFormat(LogGcSetOrigin,&buf);
       
  1664 		}
       
  1665 		break;
       
  1666 	case EWsGcOpStartSegmentedDrawPolygon:
       
  1667 		{
       
  1668 		_LIT(LogGcStartSegmentedDrawPolygon,"StartSegmentedDrawPolygon(%d)");
       
  1669 		aText.AppendFormat(LogGcStartSegmentedDrawPolygon,*pData.StartSegmentedDrawPolygon);
       
  1670 		}
       
  1671 		break;
       
  1672 	case EWsGcOpSegmentedDrawPolygonData:
       
  1673 		{
       
  1674 		_LIT(LogGcSegmentedDrawPolygonData,"SegmentedDrawPolygonData(%d,%d,...)");
       
  1675 		aText.AppendFormat(LogGcSegmentedDrawPolygonData,pData.SegmentedDrawPolygonData->index,
       
  1676 									pData.SegmentedDrawPolygonData->numPoints);
       
  1677 		}
       
  1678 		break;
       
  1679 	case EWsGcOpDrawSegmentedPolygon:
       
  1680 		{
       
  1681 		_LIT(LogGcDrawSegmentedPolygon,"DrawSegmentedPolygon()");
       
  1682 		aText.AppendFormat(LogGcDrawSegmentedPolygon);
       
  1683 		}
       
  1684 		break;
       
  1685 	case EWsGcOpDrawRect:
       
  1686 		{
       
  1687 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
       
  1688 		_LIT(LogGcDrawRect,"DrawRect(%S)");
       
  1689 		aText.AppendFormat(LogGcDrawRect,&buf);
       
  1690 		}
       
  1691 		break;
       
  1692 	case EWsGcOpDrawBitmap:
       
  1693 		{
       
  1694 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.Bitmap->pos));
       
  1695 		_LIT(KLitGcDrawBitmap, "DrawBitmap({%d}, %S)");
       
  1696 		aText.AppendFormat(KLitGcDrawBitmap, hHandleToValue(pData.Bitmap->handle), &buf);
       
  1697 		}
       
  1698 		break;
       
  1699 	case EWsGcOpDrawBitmap2:
       
  1700 		{
       
  1701 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.Bitmap2->rect));
       
  1702 		_LIT(KLitGcDrawBitmap2, "DrawBitmap2({%d}, %S)");
       
  1703 		aText.AppendFormat(KLitGcDrawBitmap2, hHandleToValue(pData.Bitmap2->handle), &buf);
       
  1704 		}
       
  1705 		break;
       
  1706 	case EWsGcOpDrawBitmap3:
       
  1707 		{
       
  1708 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.Bitmap3->rect));
       
  1709 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.Bitmap3->srcRect));
       
  1710 		_LIT(KLitGcDrawBitmap3, "DrawBitmap3({%d}, %S, %S)");
       
  1711 		aText.AppendFormat(KLitGcDrawBitmap3, hHandleToValue(pData.Bitmap3->handle), &buf1, &buf2);
       
  1712 		}
       
  1713 		break;
       
  1714 	case EWsGcOpDrawBitmapMasked:
       
  1715 	case EWsGcOpWsDrawBitmapMasked:
       
  1716 		{
       
  1717 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iRect));
       
  1718 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iSrcRect));
       
  1719 		_LIT(KLitGcDrawBitmapMasked, "DrawBitmapMasked(%S, {%d}, %S, {%d}, %d)");
       
  1720 		aText.AppendFormat(KLitGcDrawBitmapMasked, &buf1, hHandleToValue(pData.iBitmapMasked->iHandle), 
       
  1721 			&buf2, hHandleToValue(pData.iBitmapMasked->iMaskHandle), pData.iBitmapMasked->iInvertMask);
       
  1722 		}
       
  1723 		break;
       
  1724 	case EWsGcOpDrawBoxText:
       
  1725 		{
       
  1726 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box));
       
  1727 		_LIT(LogGcDrawText1,"DrawText(\"");
       
  1728 		aText.Append(LogGcDrawText1);
       
  1729 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxText+1), pData.BoxText->length));
       
  1730 		_LIT(LogGcDrawText2,"\", %S, %d, %d, %d)");
       
  1731 		aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset, 
       
  1732 										pData.BoxText->horiz, pData.BoxText->leftMrg);
       
  1733 		}
       
  1734 		break;		
       
  1735 	default:
       
  1736 		UnKnownOpcode(aText, aOpcode);
       
  1737 		break;
       
  1738 		}
       
  1739 	}
       
  1740 
       
  1741 void TWsDecoder::DecodeGc3(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData)
       
  1742 	{
       
  1743 	TWsGcCmdUnion pData;
       
  1744 
       
  1745 	pData.any=aCmdData;
       
  1746 	switch (aOpcode)
       
  1747 		{
       
  1748 	case EWsGcOpSetDrawMode:
       
  1749 		{
       
  1750 		_LIT(LogGcSetDrawMode,"SetDrawMode(%u)");
       
  1751 		aText.AppendFormat(LogGcSetDrawMode,*pData.UInt);
       
  1752 		}
       
  1753 		break;
       
  1754 	case EWsGcOpClearRect:
       
  1755 		{
       
  1756 		TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect));
       
  1757 		_LIT(LogGcClear,"Clear(%S)");
       
  1758 		aText.AppendFormat(LogGcClear, &buf);
       
  1759 		}
       
  1760 		break;
       
  1761 	case EWsGcOpClear:
       
  1762 		{
       
  1763 		_LIT(LogGcClear,"Clear()");
       
  1764 		aText.AppendFormat(LogGcClear);
       
  1765 		}
       
  1766 		break;
       
  1767 	case EWsGcOpGdiBlt2:
       
  1768 	case EWsGcOpGdiWsBlt2:
       
  1769 		{
       
  1770 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GdiBlt2->pos));
       
  1771 		_LIT(LogGcGdiBlt,"GdiBlt(%S, {%d})");
       
  1772 		aText.AppendFormat(LogGcGdiBlt,&buf,hHandleToValue(pData.GdiBlt2->handle));
       
  1773 		}
       
  1774 		break;
       
  1775 	case EWsGcOpGdiBlt3:
       
  1776 	case EWsGcOpGdiWsBlt3:
       
  1777 		{
       
  1778 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBlt3->pos));
       
  1779 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBlt3->rect));
       
  1780 		_LIT(LogGcGdiBlt,"GdiBlt(%S, {%d}, %S)");
       
  1781 		aText.AppendFormat(LogGcGdiBlt,&buf1,hHandleToValue(pData.GdiBlt3->handle),&buf2);
       
  1782 		}
       
  1783 		break;
       
  1784 	case EWsGcOpGdiBltMasked:
       
  1785 	case EWsGcOpGdiWsBltMasked:
       
  1786 		{
       
  1787 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBltMasked->destination));
       
  1788 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBltMasked->source));
       
  1789 		_LIT(LogGcBitBltMasked,"BitBltMasked(%S, {%d}, %S)");
       
  1790 		aText.AppendFormat(LogGcBitBltMasked, &buf1, hHandleToValue(pData.GdiBltMasked->handle),
       
  1791 										&buf2, hHandleToValue(pData.GdiBltMasked->maskHandle),
       
  1792 										pData.GdiBltMasked->invertMask);
       
  1793 		}
       
  1794 		break;
       
  1795 	case EWsGcOpSize:
       
  1796 		{
       
  1797 		_LIT(LogGcSize,"Size()");
       
  1798 		aText.AppendFormat(LogGcSize);
       
  1799 		}
       
  1800 		break;
       
  1801 	case EWsGcOpUseFont:
       
  1802 		{
       
  1803 		_LIT(LogGcUseFont,"UseFont({0x%x})");
       
  1804 		aText.AppendFormat(LogGcUseFont,hHandleToValue(*pData.handle));
       
  1805 		}
       
  1806 		break;
       
  1807 	case EWsGcOpDiscardFont:
       
  1808 		{
       
  1809 		_LIT(LogGcDiscardFont,"DiscardFont()");
       
  1810 		aText.AppendFormat(LogGcDiscardFont);
       
  1811 		}
       
  1812 		break;
       
  1813 	case EWsGcOpTestInvariant:
       
  1814 		{
       
  1815 		_LIT(LogGcTestInvariant,"unimplemented opcode 'EWsGcOpTestInvariant' (%u)");
       
  1816 		aText.AppendFormat(LogGcTestInvariant, aOpcode);
       
  1817 		}
       
  1818 		break;
       
  1819 	case EWsGcOpReset:
       
  1820 		{
       
  1821 		_LIT(LogGcReset,"Reset()");
       
  1822 		aText.Append(LogGcReset);
       
  1823 		}
       
  1824 		break;
       
  1825 	case EWsGcOpSetDitherOrigin:
       
  1826 		{
       
  1827 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1828 		_LIT(LogGcSetDitherOrigin,"SetDitherOrigin(%S)");
       
  1829 		aText.AppendFormat(LogGcSetDitherOrigin,&buf);
       
  1830 		}
       
  1831 		break;
       
  1832 	case EWsGcOpMapColors:
       
  1833 		{
       
  1834 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.MapColors->rect));
       
  1835 		_LIT(LogGcMapColors,"MapColors(%S,?,%d)");
       
  1836 		aText.AppendFormat(LogGcMapColors,&buf,pData.MapColors->numPairs);
       
  1837 		}
       
  1838 		break;
       
  1839 	case EWsGcOpSetUnderlineStyle:
       
  1840 		{
       
  1841 		_LIT(LogGcSetUnderlineStyle,"SetUnderlineStyle(%x)");
       
  1842 		aText.AppendFormat(LogGcSetUnderlineStyle,*pData.SetUnderlineStyle);
       
  1843 		}
       
  1844 		break;
       
  1845 	case EWsGcOpSetStrikethroughStyle:
       
  1846 		{
       
  1847 		_LIT(LogGcSetStrikethroughStyle,"SetStrikethroughStyle(%x)");
       
  1848 		aText.AppendFormat(LogGcSetStrikethroughStyle,*pData.SetStrikethroughStyle);
       
  1849 		}
       
  1850 		break;
       
  1851 	case EWsGcOpDrawWsGraphic:
       
  1852 	case EWsGcOpDrawWsGraphicPtr:
       
  1853 		{
       
  1854 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.WsGraphic->iRect));
       
  1855 		_LIT(KLitGcDrawWsGraphic,"DrawWsGraphic(%x, %d, %S, %d)");
       
  1856 		aText.AppendFormat(KLitGcDrawWsGraphic, pData.WsGraphic->iFlags, pData.WsGraphic->iId, &buf, pData.WsGraphic->iDataLen);
       
  1857 		}
       
  1858 		break;
       
  1859 	case EWsGcOpSetFaded:
       
  1860 		{
       
  1861 		_LIT(KLitGcSetFaded, "SetFaded(%d)");
       
  1862 		aText.AppendFormat(KLitGcSetFaded, pData.Bool);
       
  1863 		}
       
  1864 		break;
       
  1865 	case EWsGcOpSetFadeParams:
       
  1866 		{
       
  1867 		_LIT(KLitGcSetFadeParams, "SetFadeParams(BlackMap %d, WhiteMap %d)");
       
  1868 		const unsigned char *bytePtr = (const unsigned char*)(pData.UInt);
       
  1869 		aText.AppendFormat(KLitGcSetFadeParams, bytePtr[0], bytePtr[1]);
       
  1870 		}
       
  1871 		break;
       
  1872 	case EWsGcOpGdiAlphaBlendBitmaps:
       
  1873 	case EWsGcOpGdiWsAlphaBlendBitmaps:
       
  1874 		{
       
  1875 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->point));
       
  1876 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.AlphaBlendBitmaps->source));
       
  1877 		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->alphaPoint));
       
  1878 		_LIT(KLitGcAlphaBlendBitmaps,"AlphaBlendBitmaps(%S, {%d}, %S, {%d}, %S)");
       
  1879 		aText.AppendFormat(KLitGcAlphaBlendBitmaps, &buf1, hHandleToValue(pData.AlphaBlendBitmaps->bitmapHandle),
       
  1880 										&buf2, hHandleToValue(pData.AlphaBlendBitmaps->alphaHandle),
       
  1881 										&buf3);
       
  1882 		}
       
  1883 		break;
       
  1884 	case EWsGcOpSetOpaque:
       
  1885 		{
       
  1886 		_LIT(KLitGcOpSetOpaque, "SetOpaque(%d)");
       
  1887 		aText.AppendFormat(KLitGcOpSetOpaque, pData.Bool);
       
  1888 		}
       
  1889 		break;
       
  1890 	default:
       
  1891 		UnKnownOpcode(aText, aOpcode);
       
  1892 		break;
       
  1893 		}
       
  1894 	}
       
  1895 
       
  1896 void TWsDecoder::DecodeScreenDevice(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  1897 	{
       
  1898 	TWsSdCmdUnion pData;
       
  1899 	_LIT(LogScreenDevice,"CWsScreenDevice[%d]::");
       
  1900 
       
  1901 	aText.Format(LogScreenDevice,aHandle);
       
  1902 	pData.any=aCmdData;
       
  1903 	switch (aOpcode)
       
  1904 		{
       
  1905 	case EWsSdOpFree:
       
  1906 		{
       
  1907 		_LIT(LogScreenDeviceDelete,"~CWsScreenDevice()");
       
  1908 		aText.Append(LogScreenDeviceDelete);
       
  1909 		}
       
  1910 		break;
       
  1911 	case EWsSdOpPixel:
       
  1912 		{
       
  1913 		_LIT(LogScreenDevicePixel,"Pixel(%S)");
       
  1914 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point));
       
  1915 		aText.AppendFormat(LogScreenDevicePixel,&buf);
       
  1916 		}
       
  1917 		break;
       
  1918 	case EWsSdOpGetScanLine:
       
  1919 		{		//This fills up the log two much for test code
       
  1920 		aText=KNullDesC;
       
  1921 		/*_LIT(LogScreenDeviceGetScanLine,"GetScanLine(TRgb *aScanLine, %d, %S)");
       
  1922 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GetScanLine->pos));
       
  1923 		aText.AppendFormat(LogScreenDeviceGetScanLine,pData.GetScanLine->len,&buf);*/
       
  1924 		}
       
  1925 		break;
       
  1926 	case EWsSdOpHorizontalTwipsToPixels:
       
  1927 		{
       
  1928 		_LIT(LogScreenDeviceHorizontalTwipsToPixels,"HorizontalTwipsToPixels()");
       
  1929 		aText.Append(LogScreenDeviceHorizontalTwipsToPixels);
       
  1930 		}
       
  1931 		break;
       
  1932 	case EWsSdOpVerticalTwipsToPixels:
       
  1933 		{
       
  1934 		_LIT(LogScreenDeviceVerticalTwipsToPixels,"VerticalTwipsToPixels()");
       
  1935 		aText.Append(LogScreenDeviceVerticalTwipsToPixels);
       
  1936 		}
       
  1937 		break;
       
  1938 	case EWsSdOpHorizontalPixelsToTwips:
       
  1939 		{
       
  1940 		_LIT(LogScreenDeviceHorizontalPixelsToTwips,"HorizontalPixelsToTwips()");
       
  1941 		aText.Append(LogScreenDeviceHorizontalPixelsToTwips);
       
  1942 		}
       
  1943 		break;
       
  1944 	case EWsSdOpVerticalPixelsToTwips:
       
  1945 		{
       
  1946 		_LIT(LogScreenDeviceVerticalPixelsToTwips,"VerticalPixelsToTwips()");
       
  1947 		aText.Append(LogScreenDeviceVerticalPixelsToTwips);
       
  1948 		}
       
  1949 		break;
       
  1950 	case EWsSdOpPixelSize:
       
  1951 		{
       
  1952 		_LIT(LogScreenDeviceSizeInPixels,"SizeInPixels()");
       
  1953 		aText.Append(LogScreenDeviceSizeInPixels);
       
  1954 		}
       
  1955 		break;
       
  1956 	case EWsSdOpTwipsSize:
       
  1957 		{
       
  1958 		_LIT(LogScreenDeviceSizeInTwips,"SizeInTwips()");
       
  1959 		aText.Append(LogScreenDeviceSizeInTwips);
       
  1960 		}
       
  1961 		break;
       
  1962 	case EWsSdOpDisplayMode:
       
  1963 		{
       
  1964 		_LIT(LogScreenDeviceDisplayMode,"DisplayMode()");
       
  1965 		aText.Append(LogScreenDeviceDisplayMode);
       
  1966 		}
       
  1967 		break;
       
  1968 	case EWsSdOpRectCompare:
       
  1969 		{
       
  1970 		_LIT(LogScreenDeviceRectCompare,"RectCompare(%S, %S)");
       
  1971 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect1));
       
  1972 		TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect2));
       
  1973 		aText.AppendFormat(LogScreenDeviceRectCompare,&buf1,&buf2);
       
  1974 		}
       
  1975 		break;
       
  1976 	case EWsSdOpPointerRect:
       
  1977 		{
       
  1978 		_LIT(LogScreenDevicePointerRect,"PointerRect()");
       
  1979 		aText.Append(LogScreenDevicePointerRect);
       
  1980 		}
       
  1981 		break;
       
  1982 	case EWsSdOpCopyScreenToBitmap:
       
  1983 		{
       
  1984 		_LIT(LogScreenDeviceCopyScreenToBitmap,"CopyScreenToBitmap(%d)");
       
  1985 		aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap,pData.CopyScreenToBitmap->handle);
       
  1986 		}
       
  1987 		break;
       
  1988 	case EWsSdOpCopyScreenToBitmap2:
       
  1989 		{
       
  1990 		_LIT(LogScreenDeviceCopyScreenToBitmap2,"CopyScreenToBitmap(%d,%S)");
       
  1991 		TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.CopyScreenToBitmap2->rect));
       
  1992 		aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap2,pData.CopyScreenToBitmap2->handle,&buf);
       
  1993 		}
       
  1994 		break;
       
  1995 	case EWsSdOpSetScreenSizeAndRotation:
       
  1996 		{
       
  1997 		_LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %S, %d})");
       
  1998 		TShortBuf buf1(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iPixelSize));
       
  1999 		TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iTwipsSize));
       
  2000 		aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf1,&buf2,pData.PixelsTwipsAndRotation->iRotation);
       
  2001 		}
       
  2002 		break;
       
  2003 	case EWsSdOpSetScreenSizeAndRotation2:
       
  2004 		{
       
  2005 		_LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %d})");
       
  2006 		TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.PixelsAndRotation->iPixelSize));
       
  2007 		aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf,pData.PixelsAndRotation->iRotation);
       
  2008 		}
       
  2009 		break;
       
  2010 	case EWsSdOpGetDefaultScreenSizeAndRotation:
       
  2011 	case EWsSdOpGetDefaultScreenSizeAndRotation2:
       
  2012 		{
       
  2013 		_LIT(LogScreenDeviceGetDefaultScreenSizeAndRotation,"GetDefaultScreenSizeAndRotation(...)");
       
  2014 		aText.Append(LogScreenDeviceGetDefaultScreenSizeAndRotation);
       
  2015 		}
       
  2016 		break;
       
  2017 	case EWsSdOpGetNumScreenModes:
       
  2018 		{
       
  2019 		_LIT(LogScreenDeviceNumScreenModes,"NumScreenModes");
       
  2020 		aText.Append(LogScreenDeviceNumScreenModes);
       
  2021 		}
       
  2022 		break;
       
  2023 	case EWsSdOpSetScreenMode:
       
  2024 		{
       
  2025 		_LIT(LogScreenDeviceSetScreenMode,"ScreenMode(%d)");
       
  2026 		aText.AppendFormat(LogScreenDeviceSetScreenMode,pData.Int);
       
  2027 		}
       
  2028 		break;
       
  2029 	case EWsSdOpGetScreenModeSizeAndRotation:
       
  2030 	case EWsSdOpGetScreenModeSizeAndRotation2:
       
  2031 		{
       
  2032 		_LIT(LogScreenDeviceGetScreenModeSizeAndRotation,"GetScreenModeSizeAndRotation(%d)");
       
  2033 		aText.AppendFormat(LogScreenDeviceGetScreenModeSizeAndRotation,pData.Int);
       
  2034 		}
       
  2035 		break;
       
  2036 	case EWsSdOpSetScreenModeEnforcement:
       
  2037 		{
       
  2038 		_LIT(LogScreenDeviceSetScreenModeEnforcement,"SetScreenModeEnforcement(%d)");
       
  2039 		aText.AppendFormat(LogScreenDeviceSetScreenModeEnforcement,pData.Int);
       
  2040 		}
       
  2041 		break;
       
  2042 	case EWsSdOpScreenModeEnforcement:
       
  2043 		{
       
  2044 		_LIT(LogScreenDeviceScreenModeEnforcement,"ScreenModeEnforcement");
       
  2045 		aText.Append(LogScreenDeviceScreenModeEnforcement);
       
  2046 		}
       
  2047 		break;
       
  2048 	case EWsSdOpSetModeRotation:
       
  2049 		{
       
  2050 		_LIT(LogScreenDeviceSetModeRotation,"SetModeRotation(%d,%d)");
       
  2051 		aText.AppendFormat(LogScreenDeviceSetModeRotation,pData.SetScreenRotation->mode,pData.SetScreenRotation->rotation);
       
  2052 		}
       
  2053 		break;
       
  2054 	case EWsSdOpGetRotationList:
       
  2055 		{
       
  2056 		_LIT(LogScreenDeviceGetRotationList,"GetRotationList(%d)");
       
  2057 		aText.AppendFormat(LogScreenDeviceGetRotationList,pData.Int);
       
  2058 		}
       
  2059 		break;
       
  2060 	case EWsSdOpPaletteAttributes:
       
  2061 		{
       
  2062 		_LIT(LogScreenDevicePaletteAttributes,"PaletteAttributes(...)");
       
  2063 		aText.Append(LogScreenDevicePaletteAttributes);
       
  2064 		}
       
  2065 		break;
       
  2066 	case EWsSdOpSetPalette:
       
  2067 		{
       
  2068 		_LIT(LogScreenDeviceSetPalette,"SetPalette(...)");
       
  2069 		aText.Append(LogScreenDeviceSetPalette);
       
  2070 		}
       
  2071 		break;
       
  2072 	case EWsSdOpGetPalette:
       
  2073 		{
       
  2074 		_LIT(LogScreenDeviceGetPalette,"GetPalette()");
       
  2075 		aText.Append(LogScreenDeviceGetPalette);
       
  2076 		}
       
  2077 		break;
       
  2078 	case EWsSdOpGetScreenMode:
       
  2079 		{
       
  2080 		_LIT(LogScreenDeviceGetScreenMode,"CurrentScreenMode()");
       
  2081 		aText.Append(LogScreenDeviceGetScreenMode);
       
  2082 		}
       
  2083 		break;
       
  2084 	case EWsSdOpGetDefaultScreenModeOrigin:
       
  2085 		{
       
  2086 		_LIT(LogScreenDeviceGetDefaultScreenModeOrigin,"GetDefaultScreenModeOrigin()");
       
  2087 		aText.Append(LogScreenDeviceGetDefaultScreenModeOrigin);
       
  2088 		}	
       
  2089 		break;
       
  2090 	case EWsSdOpGetScreenModeOrigin:
       
  2091 		{
       
  2092 		_LIT(LogScreenDeviceGetScreenModeOrigin,"GetScreenModeOrigin(%d)");
       
  2093 		aText.AppendFormat(LogScreenDeviceGetScreenModeOrigin, pData.Int);
       
  2094 		}	
       
  2095 		break;
       
  2096 	case EWsSdOpGetScreenModeScale:
       
  2097 		{
       
  2098 		_LIT(LogScreenDeviceGetScreenModeScale,"GetScreenModeScale(%d)");
       
  2099 		aText.AppendFormat(LogScreenDeviceGetScreenModeScale, pData.Int);
       
  2100 		}	
       
  2101 		break;
       
  2102 	case EWsSdOpGetCurrentScreenModeScale:
       
  2103 		{
       
  2104 		_LIT(LogScreenDeviceGetCurrentScreenModeScale,"GetCurrentScreenModeScale()");
       
  2105 		aText.Append(LogScreenDeviceGetCurrentScreenModeScale);
       
  2106 		}	
       
  2107 		break;		
       
  2108 	case EWsSdOpSetAppScreenMode:
       
  2109 		{
       
  2110 		_LIT(LogScreenDeviceSetAppScreenMode,"SetAppScreenMode(%d)");
       
  2111 		aText.AppendFormat(LogScreenDeviceSetAppScreenMode, pData.Int);
       
  2112 		}	
       
  2113 		break;		
       
  2114 	case EWsSdOpGetScreenModeScaledOrigin:
       
  2115 		{
       
  2116 		_LIT(LogScreenDeviceGetScreenModeScaledOrigin,"GetScreenModeScaledOrigin(%d)");
       
  2117 		aText.AppendFormat(LogScreenDeviceGetScreenModeScaledOrigin, pData.Int);
       
  2118 		}	
       
  2119 		break;		
       
  2120 	case EWsSdOpGetCurrentScreenModeScaledOrigin:
       
  2121 		{
       
  2122 		_LIT(LogScreenDeviceGetCurrentScreenModeScaledOrigin,"GetCurrentScreenModeScaledOrigin()");
       
  2123 		aText.Append(LogScreenDeviceGetCurrentScreenModeScaledOrigin);
       
  2124 		}	
       
  2125 		break;		
       
  2126 	case EWsSdOpSetCurrentScreenModeAttributes:
       
  2127 		{
       
  2128 		_LIT(LogScreenDeviceSetCurrentScreenModeAttributes,"SetCurrentScreenModeAttributes(%S)");
       
  2129 		TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.ScreenSizeMode->iScreenSize));
       
  2130 		aText.AppendFormat(LogScreenDeviceSetCurrentScreenModeAttributes,&buf);
       
  2131 		}	
       
  2132 		break;		
       
  2133 	case EWsSdOpGetCurrentScreenModeAttributes:
       
  2134 		{
       
  2135 		_LIT(LogScreenDeviceGetCurrentScreenModeOrigin,"GetCurrentScreenModeAttributes()");
       
  2136 		aText.Append(LogScreenDeviceGetCurrentScreenModeOrigin);
       
  2137 		}	
       
  2138 		break;		
       
  2139 	case EWsSdOpGetScreenNumber:
       
  2140 		{
       
  2141 		_LIT(LogScreenDeviceGetScreenNumber,"GetScreenNumber()");
       
  2142 		aText.Append(LogScreenDeviceGetScreenNumber);
       
  2143 		}	
       
  2144 		break;		
       
  2145 	case EWsSdOpGetScreenSizeModeList:
       
  2146 		{
       
  2147 		_LIT(LogScreenDeviceGetScreenSizeModeList,"GetScreenSizeModeList(RArray<TInt>* aModeList)");
       
  2148 		aText.Append(LogScreenDeviceGetScreenSizeModeList);
       
  2149 		}	
       
  2150 		break;		
       
  2151 	case EWsSdOpGetScreenModeDisplayMode:
       
  2152 		{
       
  2153 		_LIT(LogScreenDeviceGetScreenModeDisplayMode,"GetScreenModeDisplayMode(%d)");
       
  2154 		aText.AppendFormat(LogScreenDeviceGetScreenModeDisplayMode, pData.Int);
       
  2155 		}	
       
  2156 		break;		
       
  2157 	case EWsClOpSetBackLight:
       
  2158 		{
       
  2159 		_LIT(LogScreenDeviceSetBackLight,"SetBackLight(%u)");
       
  2160 		aText.AppendFormat(LogScreenDeviceSetBackLight, pData.UInt);
       
  2161 		}	
       
  2162 		break;		
       
  2163 	default:
       
  2164 		UnKnownOpcode(aText, aOpcode);
       
  2165 		break;
       
  2166 		}
       
  2167 	}
       
  2168 
       
  2169 void TWsDecoder::DecodeAnimDll(TBuf<LogTBufSize>& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle)
       
  2170 	{
       
  2171 	aText.Format(_L("CAnimDll[%d]::"),aHandle);
       
  2172 	switch (aOpcode)
       
  2173 		{
       
  2174 	case EWsAnimDllOpCreateInstance:
       
  2175 		TDebugLogTextHandler::Append(aText, _L("CreateInstance(...)"));
       
  2176 		break;
       
  2177 	case EWsAnimDllOpDestroyInstance:
       
  2178 		TDebugLogTextHandler::Append(aText, LogClose);
       
  2179 		break;
       
  2180 	case EWsAnimDllOpCommandReply:
       
  2181 		TDebugLogTextHandler::Append(aText, _L("CommandReply(...)"));
       
  2182 		break;
       
  2183 	case EWsAnimDllOpCommand:
       
  2184 		TDebugLogTextHandler::Append(aText, _L("Command(...)"));
       
  2185 		break;
       
  2186 	case EWsAnimDllOpFree:
       
  2187 		aText.Append(_L("~CAnimDll()"));
       
  2188 		break;
       
  2189 	case EWsAnimDllOpCreateInstanceSprite:
       
  2190 		aText.Append(_L("EWsAnimDllOpCreateInstanceSprite enum"));
       
  2191 		break;
       
  2192 	default:
       
  2193 		UnKnownOpcode(aText, aOpcode);
       
  2194 		break;
       
  2195 		}
       
  2196 	}
       
  2197 
       
  2198 void TWsDecoder::DecodeSpriteBase(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  2199 	{
       
  2200 	TWsSpriteCmdUnion pData;
       
  2201 
       
  2202 	aText.Format(_L("RWsSpriteBase[%d]::"),aHandle);
       
  2203 	pData.any=aCmdData;
       
  2204 	switch (aOpcode)
       
  2205 		{
       
  2206 	case EWsSpriteOpFree:
       
  2207 		aText.Append(LogClose);
       
  2208 		break;
       
  2209 	case EWsSpriteOpSetPosition:
       
  2210 		aText.Append(_L("SetPosition(...)"));
       
  2211 		break;
       
  2212 	case EWsSpriteOpUpdateMember:
       
  2213 		aText.AppendFormat(_L("UpdateMember(%d)"),pData.UpdateMember->index);
       
  2214 		break;
       
  2215 	case EWsSpriteOpUpdateMember2:
       
  2216 		aText.AppendFormat(_L("UpdateMember(%d,{%d,%d,%d,%d,{%d,%d},%d})"),pData.UpdateMember->index,
       
  2217 								pData.UpdateMember->data.iBitmap,pData.UpdateMember->data.iMaskBitmap,
       
  2218 								pData.UpdateMember->data.iInvertMask,pData.UpdateMember->data.iDrawMode,
       
  2219 								pData.UpdateMember->data.iOffset.iX,pData.UpdateMember->data.iOffset.iY,
       
  2220 								pData.UpdateMember->data.iInterval.Int());
       
  2221 		break;
       
  2222 	case EWsSpriteOpAppendMember:
       
  2223 		aText.Append(_L("AppendMember(...)"));
       
  2224 		break;
       
  2225 	case EWsSpriteOpActivate:
       
  2226 		aText.Append(_L("Activate()"));
       
  2227 		break;
       
  2228 	default:
       
  2229 		UnKnownOpcode(aText, aOpcode);
       
  2230 		break;
       
  2231 		}
       
  2232 	}
       
  2233 
       
  2234 void TWsDecoder::DecodeBitmap(TBuf<LogTBufSize>& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle)
       
  2235 	{
       
  2236 	aText.Format(_L("CWsBitmap[%d]::"),aHandle);
       
  2237 	switch (aOpcode)
       
  2238 		{
       
  2239 	case EWsBitmapOpFree:
       
  2240 		aText.Append(LogClose);
       
  2241 		break;
       
  2242 	default:
       
  2243 		UnKnownOpcode(aText, aOpcode);
       
  2244 		break;
       
  2245 		}
       
  2246 	}
       
  2247 
       
  2248 void TWsDecoder::DecodeDirect(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  2249 	{
       
  2250 	TWsDirectCmdUnion pData;
       
  2251 	
       
  2252 	_LIT(KClassName,"RDirectScreenAccess[%d]::");
       
  2253 	aText.Format(KClassName,aHandle);
       
  2254 	pData.any=aCmdData;
       
  2255 	switch (aOpcode)
       
  2256 		{
       
  2257 	case EWsDirectOpFree:
       
  2258 		aText.Append(LogClose);
       
  2259 		break;
       
  2260 	case EWsDirectOpRequest:
       
  2261 		{
       
  2262 		_LIT(LogDirectRequest,"Request(TInt *stat,%d)");
       
  2263 		aText.AppendFormat(LogDirectRequest,hHandleToValue(*pData.Int));
       
  2264 		}
       
  2265 		break;
       
  2266 	case EWsDirectOpInitFailed:
       
  2267 		{
       
  2268 		_LIT(LogDirectInitFailed,"InitFailed()");
       
  2269 		aText.Append(LogDirectInitFailed);
       
  2270 		}
       
  2271 		break;
       
  2272 	case EWsDirectOpGetRegion:
       
  2273 		{
       
  2274 		_LIT(LogDirectGetRegion,"GetRegion(%d)");
       
  2275 		aText.AppendFormat(LogDirectGetRegion,pData.Int);
       
  2276 		}
       
  2277 		break;
       
  2278 	case EWsDirectOpCancel:
       
  2279 		{
       
  2280 		_LIT(LogDirectCancel,"Cancel()");
       
  2281 		aText.Append(LogDirectCancel);
       
  2282 		}
       
  2283 		break;
       
  2284 	case EWsDirectOpGetSendQueue:
       
  2285 		{
       
  2286 		_LIT(LogGetSendQueue,"EWsDirectOpGetSendQueue enum");
       
  2287 		aText.Append(LogGetSendQueue);
       
  2288 		}
       
  2289 		break;	
       
  2290 	case EWsDirectOpGetRecQueue:
       
  2291 		{
       
  2292 		_LIT(LogGetRecQueue,"EWsDirectOpGetRecQueue enum");
       
  2293 		aText.Append(LogGetRecQueue);
       
  2294 		}
       
  2295 		break;	
       
  2296 	default:
       
  2297 		UnKnownOpcode(aText, aOpcode);
       
  2298 		break;
       
  2299 		}
       
  2300 	}
       
  2301 
       
  2302 void TWsDecoder::DecodeClick(TBuf<LogTBufSize> &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  2303 	{
       
  2304 	TWsClickCmdUnion pData;
       
  2305 
       
  2306 	_LIT(KClassName,"RSoundPlugIn[%d]::");
       
  2307 	aText.Format(KClassName,aHandle);
       
  2308 	pData.any=aCmdData;
       
  2309 	switch (aOpcode)
       
  2310 		{
       
  2311 	case EWsClickOpFree:
       
  2312 		aText.Append(LogClose);
       
  2313 		break;
       
  2314 	case EWsClickOpIsLoaded:
       
  2315 		{
       
  2316 		_LIT(LogClickIsLoaded,"IsLoaded()");
       
  2317 		aText.Append(LogClickIsLoaded);
       
  2318 		}
       
  2319 		break;
       
  2320 	case EWsClickOpUnLoad:
       
  2321 		{
       
  2322 		_LIT(LogClickUnLoad,"UnLoad()");
       
  2323 		aText.Append(LogClickUnLoad);
       
  2324 		}
       
  2325 		break;
       
  2326 	case EWsClickOpLoad:
       
  2327 		{
       
  2328 		_LIT(LogClickLoad1,"Load(\"");
       
  2329 		_LIT(LogClickLoad2,"\")");
       
  2330 		TDebugLogTextHandler::Append(aText, LogClickLoad1);
       
  2331 		TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.Int+1), *pData.Int));
       
  2332 		TDebugLogTextHandler::Append(aText, LogClickLoad2);
       
  2333 		}
       
  2334 		break;
       
  2335 	case EWsClickOpCommandReply:
       
  2336 		{
       
  2337 		_LIT(LogClickCommandReply,"CommandReply(...)");
       
  2338 		aText.Append(LogClickCommandReply);
       
  2339 		}
       
  2340 		break;
       
  2341 	case EWsClickOpSetKeyClick:
       
  2342 		{			
       
  2343 		_LIT(LogSetKeyClick,"SetKeyClick(%u)");
       
  2344 		aText.AppendFormat(LogSetKeyClick, pData.Bool);
       
  2345 		}
       
  2346 		break;
       
  2347 	case EWsClickOpSetPenClick:
       
  2348 		{			
       
  2349 		_LIT(LogSetPenClick,"SetPenClick(%u)");
       
  2350 		aText.AppendFormat(LogSetPenClick, pData.Bool);
       
  2351 		}	
       
  2352 		break;
       
  2353 	case EWsClickOpKeyClickEnabled:
       
  2354 		{
       
  2355 		_LIT(LogKeyClickEnabled,"KeyClickEnabled()");
       
  2356 		aText.Append(LogKeyClickEnabled);
       
  2357 		}
       
  2358 		break;
       
  2359 	case EWsClickOpPenClickEnabled:
       
  2360 		{
       
  2361 		_LIT(LogPenClickEnabled,"PenClickEnabled()");
       
  2362 		aText.Append(LogPenClickEnabled);
       
  2363 		}
       
  2364 		break;
       
  2365 	default:
       
  2366 		UnKnownOpcode(aText, aOpcode);
       
  2367 		break;
       
  2368 		}
       
  2369 	}
       
  2370 
       
  2371 TDesC &TWsDecoder::replyBufDetails(TInt aClass, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
       
  2372 	{
       
  2373 	iCommandDetailsText.Format(_L("Reply Buffer: "));
       
  2374 	switch (aClass)
       
  2375 		{
       
  2376 	case WS_HANDLE_GROUP_WINDOW:
       
  2377 		ReplyBufWindowGroup(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
       
  2378 		break;
       
  2379 	case WS_HANDLE_CLIENT:
       
  2380 		ReplyBufClient(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
       
  2381 		break;
       
  2382 	case WS_HANDLE_WINDOW:
       
  2383 		ReplyBufWindow(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
       
  2384 		break;
       
  2385 	case WS_HANDLE_SCREEN_DEVICE:
       
  2386 		ReplyBufScreenDevice(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText);
       
  2387 		break;
       
  2388 	default:
       
  2389 		iCommandDetailsText.Format(_L("Reply buffer not handled (%u)"), aClass);
       
  2390 		UnKnown();
       
  2391 		break;
       
  2392 		}
       
  2393 	return iCommandDetailsText;
       
  2394 	}
       
  2395 
       
  2396 TDesC &TWsDecoder::commandDetails(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle)
       
  2397 	{
       
  2398 	switch (aClass)
       
  2399 		{
       
  2400 	case WS_HANDLE_ROOT_WINDOW:
       
  2401 		iCommandDetailsText.Format(_L("invalid class"));
       
  2402 		break;
       
  2403 	case WS_HANDLE_GROUP_WINDOW:
       
  2404 		DecodeWindowGroup(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2405 		break;
       
  2406 	case WS_HANDLE_CLIENT:
       
  2407 		DecodeClient(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2408 		break;
       
  2409 	case WS_HANDLE_WINDOW:
       
  2410 		DecodeWindow(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2411 		break;
       
  2412 	case WS_HANDLE_GC:
       
  2413 		DecodeGc(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2414 		break;
       
  2415 	case WS_HANDLE_SCREEN_DEVICE:
       
  2416 		DecodeScreenDevice(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2417 		break;
       
  2418 	case WS_HANDLE_ANIM_DLL:
       
  2419 		DecodeAnimDll(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2420 		break;
       
  2421 	case WS_HANDLE_SPRITE:
       
  2422 	case WS_HANDLE_POINTER_CURSOR:
       
  2423 	case WS_HANDLE_TEXT_CURSOR:
       
  2424 		DecodeSpriteBase(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2425 		break;
       
  2426 	case WS_HANDLE_BITMAP:
       
  2427 		DecodeBitmap(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2428 		break;
       
  2429 	case WS_HANDLE_DIRECT:
       
  2430 		DecodeDirect(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2431 		break;
       
  2432 	case WS_HANDLE_CLICK:
       
  2433 		DecodeClick(iCommandDetailsText, aOpcode, aCmdData, aHandle);
       
  2434 		break;
       
  2435 	default:
       
  2436 		iCommandDetailsText.Format(_L("unknown class (%u)"), aClass);
       
  2437 		UnKnown();
       
  2438 		break;
       
  2439 		}
       
  2440 	iRequestFuncClass=aClass;
       
  2441 	iPrevOpcode=aOpcode;
       
  2442 	return iCommandDetailsText;
       
  2443 	}
       
  2444 
       
  2445 TDesC &TWsDecoder::eventDetails(const TWsEvent *aWsEvent)
       
  2446 	{
       
  2447 	switch (aWsEvent->Type())
       
  2448 		{
       
  2449 	case EEventKey:
       
  2450 		iEventDetailsText.Format(_L("EEventKey (code %u, scanCode %u, mdfs 0x%04x, repeats %u)"),
       
  2451 											aWsEvent->Key()->iCode,
       
  2452 											aWsEvent->Key()->iScanCode,
       
  2453 											aWsEvent->Key()->iModifiers,
       
  2454 											aWsEvent->Key()->iRepeats);
       
  2455 		break;
       
  2456 	case EEventKeyUp:
       
  2457 		iEventDetailsText.Format(_L("EEventKeyUp (scanCode %u, mdfs 0x%04x)"),
       
  2458 											aWsEvent->Key()->iScanCode,
       
  2459 											aWsEvent->Key()->iModifiers);
       
  2460 		break;
       
  2461 	case EEventKeyDown:
       
  2462 		iEventDetailsText.Format(_L("EEventKeyDown (scanCode %u, mdfs 0x%04x)"),
       
  2463 											aWsEvent->Key()->iScanCode,
       
  2464 											aWsEvent->Key()->iModifiers);
       
  2465 		break;
       
  2466 	case EEventPointer:
       
  2467 		{
       
  2468 		TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType));
       
  2469 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition));
       
  2470 		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition));
       
  2471 		iEventDetailsText.Format(_L("EEventPointer (type %S, modifiers 0x%x, pos %S, global-pos %S)"),
       
  2472 											&buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3);
       
  2473 		}
       
  2474 		break;
       
  2475 	case EEventDragDrop:
       
  2476 		{
       
  2477 		TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType));
       
  2478 		TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition));
       
  2479 		TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition));
       
  2480 		iEventDetailsText.Format(_L("EEventDragDrop (type %S, modifiers 0x%x, pos %S, global-pos %S)"),
       
  2481 											&buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3);
       
  2482 		}
       
  2483 		break;
       
  2484 	case EEventPointerEnter:
       
  2485 		iEventDetailsText.Format(_L("EEventPointerEnter"));
       
  2486 		break;
       
  2487 	case EEventPointerExit:
       
  2488 		iEventDetailsText.Format(_L("EEventPointerExit"));
       
  2489 		break;
       
  2490 	case EEventFocusLost:
       
  2491 		iEventDetailsText.Format(_L("EEventFocusLost"));
       
  2492 		break;
       
  2493 	case EEventFocusGained:
       
  2494 		iEventDetailsText.Format(_L("EEventFocusGained"));
       
  2495 		break;
       
  2496 	case EEventModifiersChanged:
       
  2497 		iEventDetailsText.Format(_L("EEventModifiersChanged"));
       
  2498 		break;
       
  2499 	case EEventSwitchOn:
       
  2500 		iEventDetailsText.Format(_L("EEventSwitchOn"));
       
  2501 		break;
       
  2502 	case EEventPassword:
       
  2503 		iEventDetailsText.Format(_L("EEventPassword"));
       
  2504 		break;
       
  2505 	case EEventWindowGroupsChanged:
       
  2506 		iEventDetailsText.Format(_L("EEventWindowGroupsChanged"));
       
  2507 		break;
       
  2508 	case EEventErrorMessage:
       
  2509 		iEventDetailsText.Format(_L("EEventErrorMessage (%d,%d)"),aWsEvent->ErrorMessage()->iErrorCategory,aWsEvent->ErrorMessage()->iError);
       
  2510 		break;
       
  2511 	case EEventMessageReady:
       
  2512 		iEventDetailsText.Format(_L("EEventMessageReady"));
       
  2513 		break;
       
  2514 	case EEventScreenDeviceChanged:
       
  2515 		iEventDetailsText.Format(_L("EEventScreenDeviceChanged"));
       
  2516 		break;
       
  2517 	case EEventSwitchOff:
       
  2518 		{
       
  2519 		_LIT(LogEventSwitchOff,"EEventSwitchOff");
       
  2520 		iEventDetailsText.Format(LogEventSwitchOff);
       
  2521 		}
       
  2522 		break;
       
  2523 	case EEventKeySwitchOff:
       
  2524 		{
       
  2525 		_LIT(LogEventKeySwitchOff,"EEventKeySwitchOff");
       
  2526 		iEventDetailsText.Format(LogEventKeySwitchOff);
       
  2527 		}
       
  2528 		break;
       
  2529 	case EEventFocusGroupChanged:
       
  2530 		{
       
  2531 		_LIT(LogEventFocusGroupChanged,"EEventFocusGroupChanged");
       
  2532 		iEventDetailsText.Format(LogEventFocusGroupChanged);
       
  2533 		}
       
  2534 		break;
       
  2535 	case EEventCaseOpened:
       
  2536 		{
       
  2537 		_LIT(LogEventCaseOpened,"EEventCaseOpened");
       
  2538 		iEventDetailsText.Format(LogEventCaseOpened);
       
  2539 		}
       
  2540 		break;
       
  2541 	case EEventCaseClosed:
       
  2542 		{
       
  2543 		_LIT(LogEventCaseClosed,"EEventCaseClosed");
       
  2544 		iEventDetailsText.Format(LogEventCaseClosed);
       
  2545 		}
       
  2546 		break;
       
  2547 	default:
       
  2548 		if (aWsEvent->Type()>=EEventUser)
       
  2549 			iEventDetailsText.Format(_L("EEventUser[%d]"), aWsEvent->Type()-EEventUser);
       
  2550 		else
       
  2551 			{
       
  2552 			UnKnown();
       
  2553 			iEventDetailsText.Format(_L("Unknown event type=%d "), aWsEvent->Type());
       
  2554 			}
       
  2555 		break;
       
  2556 		}
       
  2557 	return iEventDetailsText;
       
  2558 	}
       
  2559 
       
  2560 TDesC &TWsDecoder::eventDetails(const TRawEvent *aEvent)
       
  2561 	{
       
  2562 	iEventDetailsText.Zero();
       
  2563 	switch (aEvent->Type())
       
  2564 		{
       
  2565 	case TRawEvent::ENone:
       
  2566 		{
       
  2567 		_LIT(LogEventDetailsNone,"ENone");
       
  2568 		iEventDetailsText.Append(LogEventDetailsNone);
       
  2569 		}
       
  2570 		break;
       
  2571 	case TRawEvent::EPointerMove:
       
  2572 		{
       
  2573 		_LIT(LogEventDetailsPointerMove,"EPointerMove(");
       
  2574 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2575 		iEventDetailsText.Append(LogEventDetailsPointerMove);
       
  2576 		iEventDetailsText.Append(buf);
       
  2577 		iEventDetailsText.Append(LogCloseBracket);
       
  2578 		}
       
  2579 		break;
       
  2580     case TRawEvent::EPointerSwitchOn:
       
  2581 		{
       
  2582 		_LIT(LogEventDetailsPointerSwitchOn,"EPointerSwitchOn(");
       
  2583 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2584 		iEventDetailsText.Append(LogEventDetailsPointerSwitchOn);
       
  2585 		iEventDetailsText.Append(buf);
       
  2586 		iEventDetailsText.Append(LogCloseBracket);
       
  2587 		}
       
  2588 		break;
       
  2589 	case TRawEvent::EKeyDown:
       
  2590 		{
       
  2591 		_LIT(LogEventDetailsKeyDown,"EKeyDown(%d)");
       
  2592 		iEventDetailsText.Format(LogEventDetailsKeyDown,aEvent->ScanCode());
       
  2593 		}
       
  2594 		break;
       
  2595 	case TRawEvent::EKeyUp:
       
  2596 		{
       
  2597 		_LIT(LogEventDetailsKeyUp,"EKeyUp(%d)");
       
  2598 		iEventDetailsText.Format(LogEventDetailsKeyUp,aEvent->ScanCode());
       
  2599 		}
       
  2600 		break;
       
  2601 	case TRawEvent::ERedraw:
       
  2602 		{
       
  2603 		_LIT(LogEventDetailsRedraw,"ERedraw");
       
  2604 		iEventDetailsText.Append(LogEventDetailsRedraw);
       
  2605 		}
       
  2606 		break;
       
  2607 	case TRawEvent::ESwitchOn:
       
  2608  		{
       
  2609 		_LIT(LogEventDetailsSwitchOn,"ESwitchOn");
       
  2610 		iEventDetailsText.Append(LogEventDetailsSwitchOn);
       
  2611 		}
       
  2612 		break;
       
  2613 	case TRawEvent::EActive:
       
  2614 		{
       
  2615 		_LIT(LogEventDetailsActive,"EActive");
       
  2616 		iEventDetailsText.Append(LogEventDetailsActive);
       
  2617 		}
       
  2618 		break;
       
  2619 	case TRawEvent::EInactive:
       
  2620 		{
       
  2621 		_LIT(LogEventDetailsInactive,"EInactive");
       
  2622 		iEventDetailsText.Append(LogEventDetailsInactive);
       
  2623 		}
       
  2624 		break;
       
  2625 	case TRawEvent::EUpdateModifiers:
       
  2626 		{
       
  2627 		_LIT(LogEventDetailsModifiers,"EUpdateModifiers(%d)");
       
  2628 		iEventDetailsText.Format(LogEventDetailsModifiers,aEvent->Modifiers());
       
  2629 		}
       
  2630 		break;
       
  2631 	case TRawEvent::EButton1Down:
       
  2632 		{
       
  2633 		_LIT(LogEventDetailsButton1Down,"EButton1Down(");
       
  2634 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2635 		iEventDetailsText.Append(LogEventDetailsButton1Down);
       
  2636 		iEventDetailsText.Append(buf);
       
  2637 		iEventDetailsText.Append(LogCloseBracket);
       
  2638 		}
       
  2639 		break;
       
  2640 	case TRawEvent::EButton1Up:
       
  2641 		{
       
  2642 		_LIT(LogEventDetailsButton1Up,"EButton1Up(");
       
  2643 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2644 		iEventDetailsText.Append(LogEventDetailsButton1Up);
       
  2645 		iEventDetailsText.Append(buf);
       
  2646 		iEventDetailsText.Append(LogCloseBracket);
       
  2647 		}
       
  2648 		break;
       
  2649 	case TRawEvent::EButton2Down:
       
  2650 		{
       
  2651 		_LIT(LogEventDetailsButton2Down,"EButton2Down(");
       
  2652 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2653 		iEventDetailsText.Append(LogEventDetailsButton2Down);
       
  2654 		iEventDetailsText.Append(buf);
       
  2655 		iEventDetailsText.Append(LogCloseBracket);
       
  2656 		}
       
  2657 		break;
       
  2658 	case TRawEvent::EButton2Up:
       
  2659 		{
       
  2660 		_LIT(LogEventDetailsButton2Up,"EButton2Up(");
       
  2661 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2662 		iEventDetailsText.Append(LogEventDetailsButton2Up);
       
  2663 		iEventDetailsText.Append(buf);
       
  2664 		iEventDetailsText.Append(LogCloseBracket);
       
  2665 		}
       
  2666 		break;
       
  2667 	case TRawEvent::EButton3Down:
       
  2668 		{
       
  2669 		_LIT(LogEventDetailsButton3Down,"EButton3Down(");
       
  2670 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2671 		iEventDetailsText.Append(LogEventDetailsButton3Down);
       
  2672 		iEventDetailsText.Append(buf);
       
  2673 		iEventDetailsText.Append(LogCloseBracket);
       
  2674 		}
       
  2675 		break;
       
  2676 	case TRawEvent::EButton3Up:
       
  2677 		{
       
  2678 		_LIT(LogEventDetailsButton3Up,"EButton3Up(");
       
  2679 		TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos()));
       
  2680 		iEventDetailsText.Append(LogEventDetailsButton3Up);
       
  2681 		iEventDetailsText.Append(buf);
       
  2682 		iEventDetailsText.Append(LogCloseBracket);
       
  2683 		}
       
  2684 		break;
       
  2685 	case TRawEvent::ESwitchOff:
       
  2686 		{
       
  2687 		_LIT(LogEventDetailsSwitchOff,"ESwitchOff");
       
  2688 		iEventDetailsText.Append(LogEventDetailsSwitchOff);
       
  2689 		}
       
  2690 		break;
       
  2691 	case TRawEvent::EKeyRepeat:
       
  2692  		{
       
  2693   		_LIT(LogEventDetailsKeyRepeat,"ERepeatKey(scancode=%d,repeat=%d");
       
  2694  		iEventDetailsText.Format(LogEventDetailsKeyRepeat,aEvent->ScanCode(),aEvent->Repeats());
       
  2695  		}
       
  2696 		break;
       
  2697 	case TRawEvent::EPointer3DOutOfRange:
       
  2698  		{
       
  2699   		_LIT(LogEventDetailsOutOfRange,"EPointer3DOutOfRange");
       
  2700  		iEventDetailsText.Format(LogEventDetailsOutOfRange);
       
  2701  		}
       
  2702 		break;
       
  2703 	default:
       
  2704 		{
       
  2705 		_LIT(LogEventDetailsUnknown,"Unknown event type: %d");
       
  2706 		iEventDetailsText.Format(LogEventDetailsUnknown,aEvent->Type());
       
  2707 		UnKnown();
       
  2708 		}
       
  2709 		break;
       
  2710 		}
       
  2711 	return iEventDetailsText;
       
  2712 	}
       
  2713 
       
  2714 void TWsDecoder::ReplyBufWindowGroup(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
       
  2715 	{
       
  2716 	ReplyBufWindow(aText, aOpcode, aReplyDes8, aReplyDesText);
       
  2717 	}
       
  2718 
       
  2719 void TWsDecoder::ReplyBufWindow(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
       
  2720 	{
       
  2721 	switch (aOpcode)
       
  2722 		{
       
  2723 	case EWsWinOpPosition:
       
  2724 		AppendPoint(aText,aReplyDes8);
       
  2725 		break;
       
  2726 	case EWsWinOpAbsPosition:
       
  2727 		AppendPoint(aText,aReplyDes8);
       
  2728 		break;
       
  2729 	case EWsWinOpSize:
       
  2730 		AppendPoint(aText,aReplyDes8);
       
  2731 		break;
       
  2732 	case EWsWinOpInquireOffset:
       
  2733 		AppendPoint(aText,aReplyDes8);
       
  2734 		break;
       
  2735 	case EWsWinOpName:
       
  2736 		AppendDesc(aText, aReplyDesText);
       
  2737 		break;
       
  2738 	case EWsWinOpRetrievePointerMoveBuffer:
       
  2739 		aText.Append(_L("..."));
       
  2740 		break;
       
  2741 	case EWsWinOpGetInvalidRegion:
       
  2742 		{
       
  2743 		TRect *rect=(TRect *)aReplyDes8->Ptr();
       
  2744 		TInt count=aReplyDes8->Size()/sizeof(TRect);
       
  2745 		TBuf<2> comma;
       
  2746 		_LIT(LogTwoStrings,"%S%S");
       
  2747 		for(TInt index=0;index<count && !iOverflowHandler.IsError();index++)
       
  2748 			{
       
  2749 			TLongBuf buf(TDebugLogTextHandler::FormatRect(*rect++));
       
  2750 			aText.AppendFormat(LogTwoStrings,&iOverflowHandler,&comma,&buf);
       
  2751 			if (index==0)
       
  2752 				comma=LogComma;
       
  2753 			}
       
  2754 		break;
       
  2755 		}
       
  2756 	default:
       
  2757 		UnKnownReplyBuf(aText, aOpcode);
       
  2758 		break;
       
  2759 		}
       
  2760 	}
       
  2761 
       
  2762 void TWsDecoder::ReplyBufClient(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText)
       
  2763 	{
       
  2764 	switch (aOpcode)
       
  2765 		{
       
  2766 	case EWsClOpGetEvent:
       
  2767 		{
       
  2768 		const TWsEvent *wsEvent=(TWsEvent *)aReplyDes8->Ptr();
       
  2769 		TPtrC details(eventDetails(wsEvent));
       
  2770 		aText=KNullDesC;
       
  2771 		if (details!=KNullDesC)
       
  2772 			{
       
  2773 			TDebugLogTextHandler::Append(aText, details);
       
  2774 			TBuf<128> buf;
       
  2775 			_LIT(LogReplyClientDestTime,"(dest %d, time ");
       
  2776 			_LIT(LogReplyClientTime,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S%.%*C2%:3)");
       
  2777 			buf.Format(LogReplyClientDestTime, wsEvent->Handle());
       
  2778 			TDebugLogTextHandler::Append(aText, buf);
       
  2779 			TRAPD(err,wsEvent->Time().FormatL(buf,LogReplyClientTime));
       
  2780 			if (err==KErrNone)
       
  2781 				TDebugLogTextHandler::Append(aText, buf);
       
  2782 			else
       
  2783 				{
       
  2784 				_LIT(LogReplyClientTimeErr,"######)");
       
  2785 				TDebugLogTextHandler::Append(aText,LogReplyClientTimeErr);
       
  2786 				}
       
  2787 			}
       
  2788 		}
       
  2789 		break;
       
  2790 	case EWsClOpGetRedraw:
       
  2791 		{
       
  2792 		const TWsRedrawEvent *redrawEvent=(TWsRedrawEvent *)aReplyDes8->Ptr();
       
  2793 		TLongBuf buf(TDebugLogTextHandler::FormatRect(redrawEvent->Rect()));
       
  2794 		aText.Format(_L("Redraw (handle %d): "), redrawEvent->Handle());
       
  2795 		aText.AppendFormat(_L("rect %S"), &buf);
       
  2796 		}
       
  2797 		break;
       
  2798 	case EWsClOpGetPriorityKey:
       
  2799 		{
       
  2800 		const TWsPriorityKeyEvent *abortEvent=(TWsPriorityKeyEvent *)aReplyDes8->Ptr();
       
  2801 		aText.Format(_L("Abort key handle %d"), abortEvent->Handle());
       
  2802 		}
       
  2803 		break;
       
  2804 	case EWsClOpShadowVector:
       
  2805 		AppendPoint(aText,aReplyDes8);
       
  2806 		break;
       
  2807 	case EWsClOpGetWindowGroupClientThreadId:
       
  2808 		{
       
  2809 		const TThreadId *threadId=(TThreadId *)aReplyDes8->Ptr();
       
  2810 		aText.Format(_L("TThreadId=%d"), *(TInt *)threadId);
       
  2811 		}
       
  2812 		break;
       
  2813 	case EWsClOpGetWindowGroupNameFromIdentifier:
       
  2814 		AppendDesc(aText, aReplyDesText);
       
  2815 		break;
       
  2816 	case EWsClOpWindowGroupList:
       
  2817 	case EWsClOpWindowGroupListAndChain: 
       
  2818 	case EWsClOpWindowGroupListAllPriorities:
       
  2819 		{
       
  2820 		TInt *handlPtr=(TInt *)aReplyDes8->Ptr();
       
  2821 		TInt count=aReplyDes8->Size()/sizeof(TInt);
       
  2822 		TBuf<2> comma;
       
  2823 		_LIT(LogStringInt,"%S%d");
       
  2824 		for(TInt index=0;index<count && !iOverflowHandler.IsError();index++)
       
  2825 			{
       
  2826 			aText.AppendFormat(LogStringInt,&iOverflowHandler,&comma,*handlPtr++);
       
  2827 			if (index==0)
       
  2828 				comma=LogComma;
       
  2829 			}
       
  2830 		}
       
  2831 		break;
       
  2832 	case EWsClOpGetKeyboardRepeatRate:
       
  2833 		{
       
  2834 		SKeyRepeatSettings *settings=(SKeyRepeatSettings *)aReplyDes8->Ptr();
       
  2835 		aText.AppendFormat(_L("initial=%d,normal=%d"),settings->iInitialTime.Int(),settings->iTime.Int());
       
  2836 		}
       
  2837 		break;
       
  2838 	case EWsClOpGetDoubleClickSettings:
       
  2839 		{
       
  2840 		SDoubleClickSettings *settings=(SDoubleClickSettings *)aReplyDes8->Ptr();
       
  2841 		aText.AppendFormat(_L("interval=%d,distance=%d"),settings->iInterval.Int(),settings->iDistance);
       
  2842 		}
       
  2843 		break;
       
  2844 	case EWsClOpFetchMessage:
       
  2845 		{
       
  2846 		_LIT(LogClientRetFetchMessage,"FetchMessage");
       
  2847 		aText.Append(LogClientRetFetchMessage);
       
  2848 		}
       
  2849 		break;
       
  2850 	case EWsClOpCreateGraphic:
       
  2851 		aText.AppendFormat(_L("Creating graphic: %s"), aReplyDes8);
       
  2852 		break;
       
  2853 	case EWsClOpGetGraphicMessage: 
       
  2854 		aText.AppendFormat(_L("Graphic message: %s"), aReplyDes8);
       
  2855 		break;
       
  2856 	case EWsClOpPointerCursorPosition:
       
  2857 		{
       
  2858 		TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr();
       
  2859 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area));
       
  2860 		aText.AppendFormat(_L("Cursor position area=%S"), &buf1);
       
  2861 		}
       
  2862 		break;
       
  2863 	case EWsClOpPointerCursorArea:
       
  2864 		{
       
  2865 		TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr();
       
  2866 		TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area));
       
  2867 		aText.AppendFormat(_L("Cursor area=%S"), &buf1);
       
  2868 		}
       
  2869 		break;
       
  2870 	case EWsClOpGetDefModeMaxNumColors:
       
  2871 		{
       
  2872 		SDefModeMaxNumColors *settings=(SDefModeMaxNumColors*)aReplyDes8->Ptr();
       
  2873 		aText.AppendFormat(_L("Num of colors=%d, num of grays=%d, display mode=%d"),settings->iColors, settings->iGrays, settings->iDisplayMode);
       
  2874 		}
       
  2875 		break;
       
  2876 	default:
       
  2877 		UnKnownReplyBuf(aText, aOpcode);
       
  2878 		break;
       
  2879 		}
       
  2880 	}
       
  2881 
       
  2882 void TWsDecoder::ReplyBufScreenDevice(TBuf<LogTBufSize> &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *)
       
  2883 	{
       
  2884 	switch (aOpcode)
       
  2885 		{
       
  2886 	case EWsSdOpGetScanLine:
       
  2887 		{			//This fills up the log two much for test code
       
  2888 		aText=KNullDesC;
       
  2889 		//Alternate code that would log this information.
       
  2890 		/*_LIT(LogScreenDeviceReplyBufGetScanLine,"aScanLine set to ...");
       
  2891 		aText=LogScreenDeviceReplyBufGetScanLine;*/
       
  2892 		/*TDebugLogTextHandler::Append(aText, TDebugLogTextHandler::FormatArray(TDebugLogTextHandler::ERgb,
       
  2893 														((TDesC8 *)aReplyData)->Ptr(),((TDesC8 *)aReplyData)->Length()*sizeof(TRgb)));*/
       
  2894 		}
       
  2895 		break;
       
  2896 	case EWsSdOpHorizontalTwipsToPixels:
       
  2897 	case EWsSdOpVerticalTwipsToPixels:
       
  2898 	case EWsSdOpHorizontalPixelsToTwips:
       
  2899 	case EWsSdOpVerticalPixelsToTwips:
       
  2900 	case EWsSdOpPixelSize:
       
  2901 	case EWsSdOpTwipsSize:
       
  2902 		AppendPoint(aText,aReplyDes8);
       
  2903 		break;
       
  2904 	case EWsSdOpPointerRect:
       
  2905 		AppendRect(aText,aReplyDes8);
       
  2906 		break;
       
  2907 	case EWsSdOpGetDefaultScreenSizeAndRotation:
       
  2908 	case EWsSdOpGetScreenModeSizeAndRotation:
       
  2909 		{
       
  2910 		_LIT(LogScreenDeviceReplyBufPTR,"%S %S %d");
       
  2911 		const TPixelsTwipsAndRotation *sar=(TPixelsTwipsAndRotation *)aReplyDes8->Ptr();
       
  2912 		TShortBuf buf1(TDebugLogTextHandler::FormatSize(sar->iPixelSize));
       
  2913 		TShortBuf buf2(TDebugLogTextHandler::FormatSize(sar->iTwipsSize));
       
  2914 		aText.AppendFormat(LogScreenDeviceReplyBufPTR,&buf1,&buf2,sar->iRotation);
       
  2915 		}
       
  2916 		break;
       
  2917 	case EWsSdOpGetDefaultScreenSizeAndRotation2:
       
  2918 	case EWsSdOpGetScreenModeSizeAndRotation2:
       
  2919 		{
       
  2920 		_LIT(LogScreenDeviceReplyBufPR,"%S %d");
       
  2921 		const TPixelsAndRotation *sar=(TPixelsAndRotation *)aReplyDes8->Ptr();
       
  2922 		TShortBuf buf(TDebugLogTextHandler::FormatSize(sar->iPixelSize));
       
  2923 		aText.AppendFormat(LogScreenDeviceReplyBufPR,&buf,sar->iRotation);
       
  2924 		}
       
  2925 		break;
       
  2926 	case EWsSdOpGetPalette:
       
  2927 		{
       
  2928 		_LIT(LogScreenDeviceReplyBufGetPalette,"Palette returned ...");
       
  2929 		aText.Append(LogScreenDeviceReplyBufGetPalette);
       
  2930 		}
       
  2931 		break;
       
  2932 	case EWsSdOpGetDefaultScreenModeOrigin:	
       
  2933 		{
       
  2934 		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
       
  2935 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
       
  2936 		_LIT(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin,"Default screen mode origin=%S");
       
  2937 		aText.AppendFormat(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin, &buf1);
       
  2938 		}
       
  2939 		break;
       
  2940 	case EWsSdOpGetScreenModeOrigin:	
       
  2941 		{
       
  2942 		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
       
  2943 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
       
  2944 		_LIT(LogScreenDeviceReplyBufGetScreenModeOrigin,"Screen mode origin=%S");
       
  2945 		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeOrigin, &buf1);
       
  2946 		}
       
  2947 		break;
       
  2948 	case EWsSdOpGetScreenModeScale: 	
       
  2949 	case EWsSdOpGetCurrentScreenModeScale:	
       
  2950 		{
       
  2951 		const TSize *size = reinterpret_cast<const TSize*>(aReplyDes8->Ptr());
       
  2952 		TShortBuf buf1(TDebugLogTextHandler::FormatSize(*size));
       
  2953 		_LIT(LogScreenDeviceReplyBufGetScreenScale,"Screen scale=%S");
       
  2954 		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenScale, &buf1);
       
  2955 		}
       
  2956 		break;
       
  2957 	case EWsSdOpGetScreenModeScaledOrigin: 
       
  2958 		{
       
  2959 		const TPoint *point = reinterpret_cast<const TPoint*>(aReplyDes8->Ptr());
       
  2960 		TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point));
       
  2961 		_LIT(LogScreenDeviceReplyBufGetScreenModeScaledOrigin,"Screen mode scaled origin=%S");
       
  2962 		aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeScaledOrigin, &buf1);
       
  2963 		}
       
  2964 		break;
       
  2965 	case EWsSdOpGetCurrentScreenModeAttributes:	
       
  2966 		{
       
  2967 		TSizeMode *settings=(TSizeMode*)aReplyDes8->Ptr();
       
  2968 		TShortBuf origin(TDebugLogTextHandler ::FormatPoint(settings->iOrigin));
       
  2969 		TShortBuf size(TDebugLogTextHandler ::FormatSize(settings->iScreenSize));
       
  2970 		TShortBuf area(TDebugLogTextHandler ::FormatRect(settings->iPointerCursorArea));
       
  2971 		aText.AppendFormat(_L("Screen attribute: origin=%S, size=%s, rotation=%d, area=$s, display mode = %d"), 
       
  2972 							   &origin, &size, settings->iAlternativeRotations, &area, settings->iDefaultDisplayMode);
       
  2973 		}
       
  2974 		break;
       
  2975 	case EWsSdOpGetScreenSizeModeList:	
       
  2976 		AppendDesc(aText, aReplyDes8);
       
  2977 		break;	
       
  2978 	default:
       
  2979 		UnKnownReplyBuf(aText, aOpcode);
       
  2980 		break;
       
  2981 		}
       
  2982 	}