sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Decodes data into text - platform independent sl@0: // sl@0: // sl@0: sl@0: #include "../SERVER/w32cmd.h" sl@0: #include "DEBUGLOG.H" sl@0: sl@0: _LIT(LogCloseBracket,")"); sl@0: _LIT(LogComma,", "); sl@0: _LIT(LogString,"%S"); sl@0: _LIT(LogClose,"Close()"); sl@0: _LIT(LogSpaces," "); sl@0: sl@0: void TDebugLogOverflow::Overflow(TDes &aDes) sl@0: { sl@0: if (!iError) //Should never be re-entrant but just in case sl@0: { sl@0: _LIT(OverflowThreeDots,"..."); sl@0: const TInt LenThreeDots=3; sl@0: iError=ETrue; sl@0: TInt length=aDes.MaxLength(); sl@0: if (length>LenThreeDots) sl@0: { sl@0: length-=LenThreeDots; sl@0: if (aDes.Length()>length) sl@0: aDes.SetLength(length); sl@0: } sl@0: aDes.AppendFormat(OverflowThreeDots,this); sl@0: } sl@0: } sl@0: sl@0: class TRawEventX : public TRawEvent sl@0: // For bypassing protected members of TRawEvent sl@0: { sl@0: public: sl@0: inline TUint Ticks(); sl@0: inline TInt posx(); sl@0: inline TInt posy(); sl@0: inline TInt scanCode(); sl@0: }; sl@0: sl@0: inline TUint TRawEventX::Ticks() sl@0: {return(iTicks);} sl@0: inline TInt TRawEventX::posx() sl@0: {return(iU.pos.x);} sl@0: inline TInt TRawEventX::posy() sl@0: {return(iU.pos.y);} sl@0: inline TInt TRawEventX::scanCode() sl@0: {return(iU.key.scanCode __REMOVE_WINS_CHARCODE);} sl@0: sl@0: sl@0: GLDEF_C TInt hHandleToValue(TUint32 handle) sl@0: { sl@0: return(handle&0xFFFF); sl@0: } sl@0: sl@0: TDesC &TWsDecoder::CommandBuf(TInt aApp) sl@0: { sl@0: iText.Format(_L("[start of command buffer from app %d]"), aApp); sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::Command(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TPtrC details(commandDetails(aClass, aOpcode, aCmdData, aHandle)); sl@0: iText=KNullDesC; sl@0: if (details!=KNullDesC) sl@0: iText=details; sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::NewClient(TUint aConnectionHandle) sl@0: { sl@0: iText.Format(_L("Client Connected %d"), aConnectionHandle); sl@0: iRequestFuncClass=ENewClientClass; sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::CommandReply(TInt aData) sl@0: { sl@0: iText.Format(_L("returns %d (0x%x)"), aData, aData); sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::CommandReplyBuf(const TDesC8 &aDes) sl@0: { sl@0: TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, &aDes, NULL)); sl@0: iText=KNullDesC; sl@0: if (details!=KNullDesC) sl@0: { sl@0: iText=LogSpaces; sl@0: TDebugLogTextHandler::Append(iText, details); sl@0: } sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::CommandReplyBuf(const TDesC16 &aDes) sl@0: { sl@0: iOverflowHandler.Reset(); sl@0: TPtrC details(replyBufDetails(iRequestFuncClass, iPrevOpcode, NULL, &aDes)); sl@0: iText=KNullDesC; sl@0: if (details!=KNullDesC) sl@0: { sl@0: iText=LogSpaces; sl@0: TDebugLogTextHandler::Append(iText, details); sl@0: } sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::SignalEvent(TInt aApp) sl@0: { sl@0: iText.Format(_L("Event signalled for App %d"),aApp); sl@0: return iText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::Panic(TInt aApp, TInt aReason) sl@0: { sl@0: if (aApp==CDebugLogBase::EDummyConnectionId) sl@0: iText.Format(_L("WSERV Internal Panic (%d)"), aReason); sl@0: else sl@0: iText.Format(_L("App %d, Paniced (%d)"),aApp, aReason); sl@0: return iText; sl@0: } sl@0: sl@0: void TWsDecoder::UnKnown() sl@0: { sl@0: } sl@0: sl@0: void TWsDecoder::UnKnownOpcode(TBuf &aText, TInt aOpcode) sl@0: { sl@0: aText.AppendFormat(_L("unknown function (opcode %u)"), aOpcode); sl@0: UnKnown(); sl@0: } sl@0: sl@0: void TWsDecoder::UnKnownReplyBuf(TBuf &aText, TInt aOpcode) sl@0: { sl@0: aText.AppendFormat(_L("unknown reply buffer (opcode %u)"), aOpcode); sl@0: UnKnown(); sl@0: } sl@0: sl@0: TDesC &TWsDecoder::MiscMessage(const TDesC &aFormat,TInt aParam) sl@0: { sl@0: iText.Format(aFormat,aParam); sl@0: return iText; sl@0: } sl@0: sl@0: void TWsDecoder::AppendPoint(TBuf &aText, const TDesC8 *aReplyDes8) sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*((TPoint *)aReplyDes8->Ptr()))); sl@0: aText.AppendFormat(LogString, &buf); sl@0: } sl@0: sl@0: void TWsDecoder::AppendRect(TBuf &aText, const TDesC8 *aReplyDes8) sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*((TRect *)aReplyDes8->Ptr()))); sl@0: aText.AppendFormat(LogString, &buf); sl@0: } sl@0: sl@0: void TWsDecoder::AppendDesc(TBuf &aText, const TDesC8 *aReplyDes8) sl@0: { sl@0: TBuf buf; sl@0: buf.Copy(*aReplyDes8); sl@0: aText.AppendFormat(LogString, &buf); sl@0: } sl@0: sl@0: void TWsDecoder::AppendDesc(TBuf &aText, const TDesC16 *aReplyDes16) sl@0: { sl@0: aText.AppendFormat(LogString, aReplyDes16); sl@0: } sl@0: sl@0: void TWsDecoder::DecodeWindowGroup(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: aText.Format(_L("RWindowGroup[%d]::"),aHandle); sl@0: TWsWinCmdUnion pData; sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsWinOpReceiveFocus: sl@0: aText.AppendFormat(_L("ReceiveFocus(%d)"), *pData.Bool); sl@0: break; sl@0: case EWsWinOpAutoForeground: sl@0: aText.AppendFormat(_L("AutoForeground(%d)"), *pData.Bool); sl@0: break; sl@0: case EWsWinOpCancelCaptureKey: sl@0: aText.AppendFormat(_L("CancelCaptureKey(%d)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpCaptureKey: sl@0: aText.AppendFormat(_L("CaptureKey(%u, 0x%04x, 0x%04x)"), sl@0: pData.CaptureKey->key, sl@0: pData.CaptureKey->modifiers, sl@0: pData.CaptureKey->modifierMask); sl@0: break; sl@0: case EWsWinOpCancelCaptureKeyUpsAndDowns: sl@0: aText.AppendFormat(_L("CancelCaptureKeyUpsAndDowns(%d)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpCaptureKeyUpsAndDowns: sl@0: aText.AppendFormat(_L("CaptureKeyUpsAndDowns(%u, 0x%04x, 0x%04x)"), sl@0: pData.CaptureKey->key, sl@0: pData.CaptureKey->modifiers, sl@0: pData.CaptureKey->modifierMask); sl@0: break; sl@0: case EWsWinOpSetTextCursor: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos)); sl@0: aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x})"), sl@0: hHandleToValue(pData.SetTextCursor->window), &buf, sl@0: pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight, sl@0: pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth, sl@0: pData.SetTextCursor->cursor.iFlags); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTextCursorClipped: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetTextCursor->pos)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.SetTextCursor->rect)); sl@0: aText.AppendFormat(_L("SetTextCursor(%d, %S, {%u,%d,%d,%d,0x%08x}, %S)"), sl@0: hHandleToValue(pData.SetTextCursor->window), &buf1, sl@0: pData.SetTextCursor->cursor.iType, pData.SetTextCursor->cursor.iHeight, sl@0: pData.SetTextCursor->cursor.iAscent, pData.SetTextCursor->cursor.iWidth, sl@0: pData.SetTextCursor->cursor.iFlags, &buf2); sl@0: } sl@0: break; sl@0: case EWsWinOpCancelTextCursor: sl@0: aText.AppendFormat(_L("CancelTextCursor()")); sl@0: break; sl@0: case EWsWinOpSetOrdinalPriorityAdjust: sl@0: aText.AppendFormat(_L("SetOrdinalPriorityAdjust(%d)"), *pData.Int); sl@0: break; sl@0: case EWsWinOpAddPriorityKey: sl@0: aText.AppendFormat(_L("AddPriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode); sl@0: break; sl@0: case EWsWinOpRemovePriorityKey: sl@0: aText.AppendFormat(_L("RemovePriorityKey(0x%x,0x%x,%d)"), pData.PriorityKey->modifiers, pData.PriorityKey->modifierMask, pData.PriorityKey->keycode); sl@0: break; sl@0: case EWsWinOpSetOrdinalPositionErr: sl@0: aText.AppendFormat(_L("SetOrdinalPositionErr(%d, %d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority); sl@0: break; sl@0: case EWsWinOpDisableKeyClick: sl@0: aText.AppendFormat(_L("DisableKeyClick(%u)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpCaptureLongKey: sl@0: aText.AppendFormat(_L("CaptureLongKey(TTimeIntervalMicroSeconds32(%d), %u, %u, %u, %u, %d, %u)"), sl@0: pData.CaptureLongKey->delay.Int(), pData.CaptureLongKey->inputKey, pData.CaptureLongKey->outputKey, sl@0: pData.CaptureLongKey->modifierMask, pData.CaptureLongKey->modifiers, pData.CaptureLongKey->priority, pData.CaptureLongKey->flags); sl@0: break; sl@0: case EWsWinOpCancelCaptureLongKey: sl@0: aText.AppendFormat(_L("CancelCaptureLongKey(%d)"), pData.CaptureKey->key); sl@0: break; sl@0: case EWsWinOpAllowChildWindowGroup: sl@0: aText.AppendFormat(_L("AllowProcessToCreateChildWindowGroup(%d)"), *pData.Int); sl@0: break; sl@0: case EWsWinOpClearChildGroup: sl@0: aText.AppendFormat(_L("ClearChildGroup()")); sl@0: break; sl@0: case EWsWinOpSetChildGroup: sl@0: aText.AppendFormat(_L("SetChildGroup(%d)"), *pData.Int); sl@0: break; sl@0: case EWsWinOpEnableVisibilityChangeEvents: sl@0: aText.Append(_L("EnableVisibilityChangeEvents()")); sl@0: break; sl@0: case EWsWinOpDisableVisibilityChangeEvents: sl@0: aText.Append(_L("DisableVisibilityChangeEvents()")); sl@0: break; sl@0: case EWsWinOpWindowGroupId: sl@0: aText.Append(_L("WindowGroupId()")); sl@0: break; sl@0: case EWsWinOpEnableFocusChangeEvents: sl@0: aText.Append(_L("EnableFocusChangeEvents()")); sl@0: break; sl@0: case EWsWinOpDisableFocusChangeEvents: sl@0: aText.Append(_L("DisableFocusChangeEvents()")); sl@0: break; sl@0: default: sl@0: decodeWindow(aText,aOpcode,aCmdData); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeClient(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TWsClCmdUnion pData; sl@0: sl@0: aText.Format(_L("RWsSession[%d]::"),aHandle); sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsClOpDisconnect: sl@0: aText.AppendFormat(LogClose); sl@0: break; sl@0: case EWsClOpSetHotKey: sl@0: aText.AppendFormat(_L("SetHotKey(%u, %u, 0x%04x, 0x%04x)"), sl@0: pData.SetHotKey->type, sl@0: pData.SetHotKey->keycode, sl@0: pData.SetHotKey->modifiers, sl@0: pData.SetHotKey->modifierMask); sl@0: break; sl@0: case EWsClOpClearHotKeys: sl@0: aText.AppendFormat(_L("ClearHotKeys(%d)"),*pData.UInt); sl@0: break; sl@0: case EWsClOpRestoreDefaultHotKey: sl@0: aText.AppendFormat(_L("ResetDefaultHotKey(%d)"),*pData.UInt); sl@0: break; sl@0: case EWsClOpComputeMode: sl@0: aText.AppendFormat(_L("ComputeMode(%u)"),*pData.UInt); sl@0: break; sl@0: case EWsClOpEventReady: sl@0: aText.AppendFormat(_L("EventReady(TInt *stat)")); sl@0: break; sl@0: case EWsClOpRedrawReady: sl@0: aText.AppendFormat(_L("RedrawReady(TInt *stat)")); sl@0: break; sl@0: case EWsClOpPriorityKeyReady: sl@0: aText.AppendFormat(_L("PriorityKeyReady(TInt *stat)")); sl@0: break; sl@0: case EWsClOpEventReadyCancel: sl@0: aText.AppendFormat(_L("EventReadyCancel()")); sl@0: break; sl@0: case EWsClOpRedrawReadyCancel: sl@0: aText.AppendFormat(_L("RedrawReadyCancel()")); sl@0: break; sl@0: case EWsClOpPriorityKeyReadyCancel: sl@0: aText.AppendFormat(_L("PriorityKeyReadyCancel()")); sl@0: break; sl@0: case EWsClOpGetEvent: sl@0: aText.AppendFormat(_L("GetEvent(TWsEvent *aEvent)")); sl@0: break; sl@0: case EWsClOpGetRedraw: sl@0: aText.AppendFormat(_L("GetRedraw(TWsRedrawEvent *aEvent)")); sl@0: break; sl@0: case EWsClOpGetPriorityKey: sl@0: aText.AppendFormat(_L("GetPriorityKey(TWsPriorityKeyEvent *aEvent)")); sl@0: break; sl@0: case EWsClOpCreateWindow: sl@0: case EWsClOpCreateGc: sl@0: case EWsClOpCreateWindowGroup: sl@0: case EWsClOpCreateAnimDll: sl@0: case EWsClOpCreateScreenDevice: sl@0: case EWsClOpCreateSprite: sl@0: case EWsClOpCreatePointerCursor: sl@0: case EWsClOpCreateBitmap: sl@0: case EWsClOpCreateDirectScreenAccess: sl@0: case EWsClOpCreateClick: sl@0: switch(aOpcode) sl@0: { sl@0: case EWsClOpCreateWindow: sl@0: aText.AppendFormat(_L("CreateWindow(%d,%x)"),hHandleToValue(pData.CreateWindow->parent),pData.CreateWindow->clientHandle); sl@0: break; sl@0: case EWsClOpCreateGc: sl@0: aText.AppendFormat(_L("CreateGc()")); sl@0: break; sl@0: case EWsClOpCreateWindowGroup: sl@0: aText.AppendFormat(_L("CreateWindowGroup(%x)"),pData.CreateWindow->clientHandle); sl@0: break; sl@0: case EWsClOpCreateAnimDll: sl@0: TDebugLogTextHandler::Append(aText, _L("LoadAnimDll(\"")); sl@0: if (pData.LoadAnimDll && (pData.LoadAnimDll->length >= 0) && (pData.LoadAnimDll->length < LogTBufSize - 22)) sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.LoadAnimDll+1), pData.LoadAnimDll->length)); sl@0: else sl@0: TDebugLogTextHandler::Append(aText, _L("")); sl@0: TDebugLogTextHandler::Append(aText, _L("\")")); sl@0: break; sl@0: case EWsClOpCreateScreenDevice: sl@0: aText.AppendFormat(_L("CreateScreenDevice()")); sl@0: break; sl@0: case EWsClOpCreateSprite: sl@0: aText.AppendFormat(_L("CreateSprite(...)")); sl@0: break; sl@0: case EWsClOpCreatePointerCursor: sl@0: aText.AppendFormat(_L("CreatePointerCursor(...)")); sl@0: break; sl@0: case EWsClOpCreateBitmap: sl@0: aText.AppendFormat(_L("CreateBitmap(...)")); sl@0: break; sl@0: case EWsClOpCreateDirectScreenAccess: sl@0: aText.AppendFormat(_L("CreateDirectScreenAccess()")); sl@0: break; sl@0: case EWsClOpCreateClick: sl@0: aText.AppendFormat(_L("CreateSoundPlugin()")); sl@0: break; sl@0: } sl@0: break; sl@0: case EWsClOpHeapCount: sl@0: aText.AppendFormat(_L("HeapCount()")); sl@0: break; sl@0: case EWsClOpDebugInfo: sl@0: aText.AppendFormat(_L("DebugInfo(%d,%d)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam); sl@0: break; sl@0: case EWsClOpDebugInfoReplyBuf: sl@0: aText.AppendFormat(_L("DebugInfo(%d,%d,...)"), pData.DebugInfo->iFunction, pData.DebugInfo->iParam); sl@0: break; sl@0: case EWsClOpTestInvariant: sl@0: aText.AppendFormat(_L("unimplemented opcode 'EWsClOpTestInvariant' (%u)"), aOpcode); sl@0: break; sl@0: case EWsClOpSetShadowVector: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: aText.AppendFormat(_L("SetShadowVector(%S)"), &buf); sl@0: break; sl@0: } sl@0: case EWsClOpShadowVector: sl@0: aText.Append(_L("ShadowVector()")); sl@0: break; sl@0: case EWsClOpResourceCount: sl@0: aText.Append(_L("ResourceCount()")); sl@0: break; sl@0: case EWsClOpSetKeyboardRepeatRate: sl@0: aText.Append(_L("SetKeyboardRepeatRate(...,...)")); sl@0: break; sl@0: case EWsClOpGetKeyboardRepeatRate: sl@0: aText.Append(_L("GetKeyboardRepeatRate(...,...)")); sl@0: break; sl@0: case EWsClOpSetDoubleClick: sl@0: aText.AppendFormat(_L("SetDoubleClickSettings(...,%d)"), pData.SetDoubleClick->distance); sl@0: break; sl@0: case EWsClOpGetDoubleClickSettings: sl@0: aText.Append(_L("GetDoubleClickSettings(...,...)")); sl@0: break; sl@0: case EWsClOpHeapSetFail: sl@0: aText.AppendFormat(_L("HeapSetFail(%d, %d)"), pData.HeapSetFail->type, pData.HeapSetFail->value); sl@0: break; sl@0: case EWsClOpNumWindowGroups: sl@0: aText.AppendFormat(_L("NumWindowGroups(%d)"),*pData.UInt); sl@0: break; sl@0: case EWsClOpNumWindowGroupsAllPriorities: sl@0: aText.Append(_L("NumWindowGroups()")); sl@0: break; sl@0: case EWsClOpWindowGroupList: sl@0: aText.AppendFormat(_L("WindowGroupList(...,%d,%d)"),pData.WindowGroupList->priority, pData.WindowGroupList->count); sl@0: break; sl@0: case EWsClOpWindowGroupListAllPriorities: sl@0: aText.AppendFormat(_L("WindowGroupList(...,%d)"),pData.WindowGroupList->count); sl@0: break; sl@0: case EWsClOpGetFocusWindowGroup: sl@0: aText.AppendFormat(_L("GetFocusWindowGroup(%d, ...)"), *pData.UInt); sl@0: break; sl@0: case EWsClOpGetDefaultOwningWindow: sl@0: aText.Append(_L("GetDefaultOwningWindow()")); sl@0: break; sl@0: case EWsClOpSetWindowGroupOrdinalPosition: sl@0: aText.AppendFormat(_L("SetWindowGroupOrdinalPosition(%d, %d)"), sl@0: pData.SetWindowGroupOrdinalPosition->identifier, sl@0: pData.SetWindowGroupOrdinalPosition->position); sl@0: break; sl@0: case EWsClOpGetWindowGroupHandle: sl@0: aText.AppendFormat(_L("GetWindowGroupHandle(%d)"),*pData.Int); sl@0: break; sl@0: case EWsClOpGetWindowGroupOrdinalPriority: sl@0: aText.AppendFormat(_L("GetWindowGroupOrdinalPriority(%d)"),*pData.Int); sl@0: break; sl@0: case EWsClOpGetWindowGroupClientThreadId: sl@0: aText.AppendFormat(_L("GetWindowGroupClientThreadId(%d)"),*pData.Int); sl@0: break; sl@0: case EWsClOpGetWindowGroupNameFromIdentifier: sl@0: aText.AppendFormat(_L("GetWindowGroupNameFromIdentifier(%d)"),pData.GetWindowGroupNameFromIdentifier->identifier); sl@0: break; sl@0: case EWsClOpFindWindowGroupIdentifier: sl@0: aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,...,%d)"),pData.FindWindowGroupIdentifier->identifier, sl@0: pData.FindWindowGroupIdentifier->offset); sl@0: break; sl@0: case EWsClOpFindWindowGroupIdentifierThread: sl@0: aText.AppendFormat(_L("FindWindowGroupIdentifier(%d,0x%x)"),pData.FindWindowGroupIdentifierThread->identifier, sl@0: pData.FindWindowGroupIdentifierThread->threadId.Id()); sl@0: break; sl@0: case EWsClOpSendMessageToWindowGroup: sl@0: aText.AppendFormat(_L("SendMessageToWindowGroup(0x%x,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority, sl@0: pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength); sl@0: break; sl@0: case EWsClOpSendMessageToAllWindowGroups: sl@0: aText.AppendFormat(_L("SendMessageToAllWindowGroups(0x%x,...)"),pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength); sl@0: break; sl@0: case EWsClOpSendMessageToAllWindowGroupsPriority: sl@0: aText.AppendFormat(_L("SendMessageToAllWindowGroups(%d,0x%x,...)"),pData.SendMessageToWindowGroup->identifierOrPriority, sl@0: pData.SendMessageToWindowGroup->uid, pData.SendMessageToWindowGroup->dataLength); sl@0: break; sl@0: case EWsClOpFetchMessage: sl@0: aText.AppendFormat(_L("FetchMessage(...)")); sl@0: break; sl@0: case EWsClOpSetSystemPointerCursor: sl@0: aText.AppendFormat(_L("SetSystemPointerCursor(...,%d)"), pData.SetSystemPointerCursor->number); sl@0: break; sl@0: case EWsClOpClearSystemPointerCursor: sl@0: aText.AppendFormat(_L("ClearSystemPointerCursor(%d)"), *pData.UInt); sl@0: break; sl@0: case EWsClOpClaimSystemPointerCursorList: sl@0: aText.Append(_L("ClaimSystemPointerCursorList()")); sl@0: break; sl@0: case EWsClOpFreeSystemPointerCursorList: sl@0: aText.Append(_L("FreeSystemPointerCursorList()")); sl@0: break; sl@0: case EWsClOpLogMessage: sl@0: aText.Append(_L("LogMessage(...)")); sl@0: break; sl@0: case EWsClOpPasswordEntered: sl@0: aText.Append(_L("PasswordEntered()")); sl@0: break; sl@0: case EWsClOpPurgePointerEvents: sl@0: aText.Append(_L("PurgePointerEvents()")); sl@0: break; sl@0: case EWsClOpRawEvent: sl@0: aText.AppendFormat(_L("SimulateRawEvent(%d,%d,{{%d,%d},%d})"),((TRawEventX *)pData.RawEvent)->Type(), sl@0: ((TRawEventX *)pData.RawEvent)->Ticks(),((TRawEventX *)pData.RawEvent)->posx(), sl@0: ((TRawEventX *)pData.RawEvent)->posy(),((TRawEventX *)pData.RawEvent)->scanCode()); sl@0: break; sl@0: case EWsClOpSendEventToWindowGroup: sl@0: aText.AppendFormat(_L("SendEventToWindowGroup(%d,"),pData.SendEventToWindowGroup->parameter); sl@0: aText.Append(eventDetails(&pData.SendEventToWindowGroup->event)); sl@0: aText.Append(LogCloseBracket); sl@0: break; sl@0: case EWsClOpSetModifierState: sl@0: aText.AppendFormat(_L("SetModifierState(%d,%d)"), pData.SetModifierState->modifier, pData.SetModifierState->state); sl@0: break; sl@0: case EWsClOpGetModifierState: sl@0: aText.Append(_L("GetModifierState()")); sl@0: break; sl@0: case EWsClOpSendOffEventsToShell: sl@0: { sl@0: _LIT(LogClientSendOffEventsToShell,"RequestOffEvents(%u,%d)"); sl@0: aText.AppendFormat(LogClientSendOffEventsToShell sl@0: ,pData.OffEventsToShell->on,hHandleToValue(pData.OffEventsToShell->window)); sl@0: } sl@0: break; sl@0: case EWsClOpGetDefModeMaxNumColors: sl@0: { sl@0: _LIT(LogClientGetDefModeMaxNumColors,"GetDefModeMaxNumColors()"); sl@0: aText.Append(LogClientGetDefModeMaxNumColors); sl@0: } sl@0: break; sl@0: case EWsClOpGetColorModeList: sl@0: { sl@0: _LIT(LogClientGetColorModeList,"GetColorModeList()"); sl@0: aText.Append(LogClientGetColorModeList); sl@0: } sl@0: break; sl@0: case EWsClOpKeyEvent: sl@0: { sl@0: _LIT(LogClientKeyEvent,"SimulateKeyEvent(%d)"); sl@0: aText.AppendFormat(LogClientKeyEvent,pData.KeyEvent->iCode); sl@0: } sl@0: break; sl@0: case EWsClOpSendEventToAllWindowGroup: sl@0: { sl@0: _LIT(LogClientSendEventToAllWindowGroups,"SendEventToAllWindowGroups("); sl@0: aText.Append(LogClientSendEventToAllWindowGroups); sl@0: aText.Append(eventDetails(&pData.SendEventToWindowGroup->event)); sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsClOpSendEventToAllWindowGroupPriority: sl@0: { sl@0: _LIT(LogClientSendEventToAllWindowGroupPriority,"SendEventToAllWindowGroups(%d,"); sl@0: aText.AppendFormat(LogClientSendEventToAllWindowGroupPriority,pData.SendEventToWindowGroup->parameter); sl@0: aText.Append(eventDetails(&pData.SendEventToWindowGroup->event)); sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsClOpSetPointerCursorArea: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.SetPointerCursorArea->area)); sl@0: _LIT(LogClientSetPointerCursorArea,"SetPointerCursorArea(%d,%S)"); sl@0: aText.AppendFormat(LogClientSetPointerCursorArea,pData.SetPointerCursorArea->mode,&buf); sl@0: } sl@0: break; sl@0: case EWsClOpPointerCursorArea: sl@0: { sl@0: _LIT(LogClientPointerCursorArea,"PointerCursorArea(%d)"); sl@0: aText.AppendFormat(LogClientPointerCursorArea,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsClOpSetPointerCursorMode: sl@0: { sl@0: _LIT(LogClientSetPointerCursorMode,"SetPointerCursorMode(%d)"); sl@0: aText.AppendFormat(LogClientSetPointerCursorMode,*pData.Mode); sl@0: } sl@0: break; sl@0: case EWsClOpPointerCursorMode: sl@0: { sl@0: _LIT(LogClientPointerCursorMode,"PointerCursorMode()"); sl@0: aText.Append(LogClientPointerCursorMode); sl@0: } sl@0: break; sl@0: case EWsClOpSetDefaultSystemPointerCursor: sl@0: { sl@0: _LIT(LogClientSetDefaultSystemPointerCursor,"SetDefaultSystemPointerCursor(%d)"); sl@0: aText.AppendFormat(LogClientSetDefaultSystemPointerCursor,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsClOpClearDefaultSystemPointerCursor: sl@0: { sl@0: _LIT(LogClientClearDefaultSystemPointerCursor,"ClearDefaultSystemPointerCursor()"); sl@0: aText.Append(LogClientClearDefaultSystemPointerCursor); sl@0: } sl@0: break; sl@0: case EWsClOpSetPointerCursorPosition: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogClientSetPointerCursorPosition,"SetPointerCursorPosition(%S)"); sl@0: aText.AppendFormat(LogClientSetPointerCursorPosition,&buf); sl@0: } sl@0: break; sl@0: case EWsClOpPointerCursorPosition: sl@0: { sl@0: _LIT(LogClientPointerCursorPosition,"PointerCursorPosition()"); sl@0: aText.Append(LogClientPointerCursorPosition); sl@0: } sl@0: break; sl@0: case EWsClOpSetDefaultFadingParams: sl@0: { sl@0: _LIT(LogClientSetDefaultFadingParams,"SetDefaultFadingParameters(%d,%d)"); sl@0: aText.AppendFormat(LogClientSetDefaultFadingParams sl@0: ,WservEncoding::ExtractFirst8BitValue(*pData.UInt),WservEncoding::ExtractSecond8BitValue(*pData.UInt)); sl@0: } sl@0: break; sl@0: case EWsClOpPrepareForSwitchOff: sl@0: { sl@0: _LIT(LogClientPrepareForSwitchOff,"PrepareForSwitchOff()"); sl@0: aText.Append(LogClientPrepareForSwitchOff); sl@0: } sl@0: break; sl@0: case EWsClOpSetFaded: sl@0: { sl@0: _LIT(LogWinSetFade,"SetSystemFade(%d"); sl@0: aText.AppendFormat(LogWinSetFade,pData.SetSystemFaded->Faded()); sl@0: if (!pData.SetSystemFaded->UseDefaultMap()) sl@0: { sl@0: _LIT(LogWinSetFade2,",%d,%d"); sl@0: TUint8 blackMap; sl@0: TUint8 whiteMap; sl@0: pData.SetSystemFaded->GetFadingParams(blackMap,whiteMap); sl@0: aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap); sl@0: } sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsClOpLogCommand: sl@0: { sl@0: _LIT(LogClientLogCommand,"LogCommand(%d)"); sl@0: aText.AppendFormat(LogClientLogCommand,*pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpSendEventToOneWindowGroupPerClient: sl@0: { sl@0: _LIT(LogClientSendEventToOneWindowGroupPerClient,"SendEventToOneWindowGroupsPerClient("); sl@0: aText.Append(LogClientSendEventToOneWindowGroupPerClient); sl@0: aText.Append(eventDetails(&pData.SendEventToWindowGroup->event)); sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsClOpStartSetCustomTextCursor: sl@0: { sl@0: _LIT(LogClientStartSetCustomTextCursor,"StartSetCustomTextCursorL(id=0x%08x, flags=0x%08x, align=%d)"); sl@0: aText.AppendFormat(LogClientStartSetCustomTextCursor, pData.CustomTextCursorData->identifier, pData.CustomTextCursorData->flags, pData.CustomTextCursorData->alignment); sl@0: } sl@0: break; sl@0: case EWsClOpCompleteSetCustomTextCursor: sl@0: { sl@0: _LIT(LogClientCompleteSetCustomTextCursor,"CompleteSetCustomTextCursorL(err=%d)"); sl@0: aText.AppendFormat(LogClientCompleteSetCustomTextCursor, *pData.Int); sl@0: } sl@0: break; sl@0: #if defined(__WINS__) sl@0: case EWsClOpRemoveKeyCode: sl@0: { sl@0: _LIT(LogClientRemoveKeyCode,"RemoveKeyCode(%d)"); sl@0: aText.AppendFormat(LogClientRemoveKeyCode,*pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpSimulateXyInput: sl@0: { sl@0: _LIT(LogClientSimulateXyInput,"SimulateXyInputType(%d)"); sl@0: aText.AppendFormat(LogClientSimulateXyInput,*pData.UInt); sl@0: } sl@0: break; sl@0: #endif sl@0: case EWsClOpSetBackgroundColor: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb)); sl@0: _LIT(LogClientSetBackgroundColor,"SetBackgroundColor(%S)"); sl@0: aText.AppendFormat(LogClientSetBackgroundColor,&buf); sl@0: } sl@0: break; sl@0: case EWsClOpGetBackgroundColor: sl@0: { sl@0: _LIT(LogClientGetBackgroundColor,"GetBackgroundColor()"); sl@0: aText.AppendFormat(LogClientGetBackgroundColor); sl@0: } sl@0: break; sl@0: case EWsClOpSystemInfo: sl@0: { sl@0: _LIT(LogClientSystemInfo,"SystemInfo(%d, SSystemInfo &aSystemInfo)"); sl@0: aText.AppendFormat(LogClientSystemInfo, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpSetFocusScreen: sl@0: { sl@0: _LIT(LogClientSetFocusScreen,"SetFocusScreen(%d)"); sl@0: aText.AppendFormat(LogClientSetFocusScreen, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpGetFocusScreen: sl@0: { sl@0: _LIT(LogClientGetFocusScreen,"GetFocusScreen()"); sl@0: aText.AppendFormat(LogClientGetFocusScreen); sl@0: } sl@0: break; sl@0: case EWsClOpWindowGroupListAndChain: sl@0: { sl@0: _LIT(LogClientWindowGroupListAndChain,"WindowGroupList(%d, RArray* aWindowList)"); sl@0: aText.AppendFormat(LogClientWindowGroupListAndChain, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpWindowGroupListAndChainAllPriorities: sl@0: { sl@0: _LIT(LogClientWindowGroupListAndChainAllPriorities,"WindowGroupListAndChainAllPriorities(RArray* aWindowList)"); sl@0: aText.AppendFormat(LogClientWindowGroupListAndChainAllPriorities); sl@0: } sl@0: break; sl@0: case EWsClOpSetClientCursorMode: sl@0: { sl@0: _LIT(LogClientSetClientCursorMode,"SetClientCursorMode(%d)"); sl@0: aText.AppendFormat(LogClientSetClientCursorMode, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpClearAllRedrawStores: sl@0: { sl@0: _LIT(LogClientClearAllRedrawStores,"ClearAllRedrawStores()"); sl@0: aText.AppendFormat(LogClientClearAllRedrawStores); sl@0: } sl@0: break; sl@0: case EWsClOpGraphicMessageReady: sl@0: { sl@0: _LIT(LogClientGraphicMessageReady,"GraphicMessageReady(%d)"); sl@0: aText.AppendFormat(LogClientGraphicMessageReady, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpGetGraphicMessage: sl@0: { sl@0: _LIT(LogClientGraphicMessage,"GetGraphicMessage(%d)"); sl@0: aText.AppendFormat(LogClientGraphicMessage, *pData.UInt); sl@0: } sl@0: break; sl@0: case EWsClOpGraphicMessageCancel: sl@0: { sl@0: _LIT(LogClientGraphicMessageCancel,"GraphicMessageCancel()"); sl@0: aText.AppendFormat(LogClientGraphicMessageCancel); sl@0: } sl@0: break; sl@0: case EWsClOpNumWindowGroupsOnScreen: sl@0: { sl@0: _LIT(LogClientNumWindowGroupsOnScreen,"NumWindowGroups(%d, %d)"); sl@0: aText.AppendFormat(LogClientNumWindowGroupsOnScreen, pData.NumWinGroups->screenNumber, pData.NumWinGroups->priority); sl@0: } sl@0: break; sl@0: case EWsClOpGetNumberOfScreens: sl@0: { sl@0: _LIT(LogClientGetNumberOfScreens,"NumberOfScreens()"); sl@0: aText.AppendFormat(LogClientGetNumberOfScreens); sl@0: } sl@0: break; sl@0: case EWsClOpNoFlickerFree: sl@0: { sl@0: _LIT(LogNoFlickerFree,"EWsClOpNoFlickerFree enum"); sl@0: aText.AppendFormat(LogNoFlickerFree); sl@0: } sl@0: break; sl@0: case EWsClOpCreateGraphic: sl@0: { sl@0: _LIT(LogCreateGraphic,"EWsClOpCreateGraphic enum"); sl@0: aText.AppendFormat(LogCreateGraphic); sl@0: } sl@0: break; sl@0: case EWsClOpRegisterSurface: sl@0: { sl@0: TInt screenNumber = pData.SurfaceRegister->screenNumber; sl@0: const TSurfaceId& surfaceId = pData.SurfaceRegister->surfaceId; sl@0: sl@0: _LIT(LogRegisterSurface,"RegisterSurface(aScreenNumber(%d), TSurfaceId{%x,%x,%x,%x})"); sl@0: aText.AppendFormat(LogRegisterSurface, screenNumber, surfaceId.iInternal[0], surfaceId.iInternal[1], surfaceId.iInternal[2], surfaceId.iInternal[3]); sl@0: } sl@0: break; sl@0: case EWsClOpUnregisterSurface: sl@0: { sl@0: TInt screenNumber = pData.SurfaceRegister->screenNumber; sl@0: const TSurfaceId& surfaceId = pData.SurfaceRegister->surfaceId; sl@0: sl@0: _LIT(LogUnregisterSurface,"UnregisterSurface(aScreenNumber(%d), TSurfaceId{%x,%x,%x,%x})"); sl@0: aText.AppendFormat(LogUnregisterSurface, screenNumber, surfaceId.iInternal[0], surfaceId.iInternal[1], surfaceId.iInternal[2], surfaceId.iInternal[3]); sl@0: } sl@0: break; sl@0: case EWsClOpSetCloseProximityThresholds: sl@0: { sl@0: _LIT(LogSetCloseProximityThresholds,"SetCloseProximityThresholds(%d, %d)"); sl@0: aText.AppendFormat(LogSetCloseProximityThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpSetHighPressureThresholds: sl@0: { sl@0: _LIT(LogSetHighPressureThresholds,"SetHighPressureThresholds(%d, %d)"); sl@0: aText.AppendFormat(LogSetHighPressureThresholds, pData.ZThresholdPair->enterThreshold, pData.ZThresholdPair->exitThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpGetEnterCloseProximityThreshold: sl@0: { sl@0: _LIT(LogGetEnterCloseProximityThreshold,"EWsClOpGetEnterCloseProximityThreshold()"); sl@0: aText.AppendFormat(LogGetEnterCloseProximityThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpGetExitCloseProximityThreshold: sl@0: { sl@0: _LIT(LogGetExitCloseProximityThreshold,"EWsClOpGetExitCloseProximityThreshold()"); sl@0: aText.AppendFormat(LogGetExitCloseProximityThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpGetEnterHighPressureThreshold: sl@0: { sl@0: _LIT(LogGetEnterHighPressureThreshold,"EWsClOpGetEnterHighPressureThreshold()"); sl@0: aText.AppendFormat(LogGetEnterHighPressureThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpGetExitHighPressureThreshold: sl@0: { sl@0: _LIT(LogGetExitHighPressureThreshold,"EWsClOpGetExitHighPressureThreshold()"); sl@0: aText.AppendFormat(LogGetExitHighPressureThreshold); sl@0: } sl@0: break; sl@0: case EWsClOpIndicateAppOrientation: sl@0: { sl@0: _LIT(LogIndicateAppOrientation,"EWsClOpIndicateAppOrientation(%d)"); sl@0: aText.AppendFormat(LogIndicateAppOrientation, *pData.Orientation); sl@0: } sl@0: break; sl@0: case EWsClOpLastEnumValue: sl@0: { sl@0: _LIT(LogLastEnumValue,"EWsClOpLastEnumValue enum"); sl@0: aText.AppendFormat(LogLastEnumValue); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeWindow(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: _LIT(LogWindow,"RWindow[%d]::"); sl@0: aText.Format(LogWindow,aHandle); sl@0: decodeWindow(aText,aOpcode,aCmdData); sl@0: } sl@0: sl@0: void TWsDecoder::decodeWindow(TBuf &aText,TInt aOpcode,const TAny *aData) sl@0: { sl@0: TWsWinCmdUnion pData; sl@0: pData.any=aData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsWinOpFree: sl@0: aText.AppendFormat(LogClose); sl@0: break; sl@0: case EWsWinOpSetExtent: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size)); sl@0: aText.AppendFormat(_L("SetExtent(%S, %S)"), &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsWinOpSetExtentErr: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.SetEx->pos)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.SetEx->size)); sl@0: aText.AppendFormat(_L("SetExtentError(%S, %S)"), &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsWinOpOrdinalPosition: sl@0: aText.AppendFormat(_L("OrdinalPosition()")); sl@0: break; sl@0: case EWsWinOpFullOrdinalPosition: sl@0: aText.AppendFormat(_L("FullOrdinalPosition()")); sl@0: break; sl@0: case EWsWinOpSetOrdinalPosition: sl@0: aText.AppendFormat(_L("SetOrdinalPosition(%d)"),*pData.Int); sl@0: break; sl@0: case EWsWinOpSetOrdinalPositionPri: sl@0: aText.AppendFormat(_L("SetOrdinalPosition(%d,%d)"), pData.OrdinalPos->pos, pData.OrdinalPos->ordinalPriority); sl@0: break; sl@0: case EWsWinOpSetPos: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.pos)); sl@0: aText.AppendFormat(_L("SetPosition(%S)"),&buf); sl@0: } sl@0: break; sl@0: case EWsWinOpSetSizeErr: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size)); sl@0: aText.AppendFormat(_L("SetSizeErr(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpSetSize: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatSize(*pData.size)); sl@0: aText.AppendFormat(_L("SetSize(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpPosition: sl@0: aText.AppendFormat(_L("Position()")); sl@0: break; sl@0: case EWsWinOpAbsPosition: sl@0: aText.AppendFormat(_L("AbsPosition()")); sl@0: break; sl@0: case EWsWinOpSize: sl@0: aText.AppendFormat(_L("Size()")); sl@0: break; sl@0: case EWsWinOpActivate: sl@0: aText.AppendFormat(_L("Activate()")); sl@0: break; sl@0: case EWsWinOpInvalidate: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect)); sl@0: aText.AppendFormat(_L("Invalidate(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpInvalidateFull: sl@0: aText.AppendFormat(_L("Invalidate()")); sl@0: break; sl@0: case EWsWinOpBeginRedraw: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.rect)); sl@0: aText.AppendFormat(_L("BeginRedraw(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpBeginRedrawFull: sl@0: aText.AppendFormat(_L("BeginRedraw()")); sl@0: break; sl@0: case EWsWinOpEndRedraw: sl@0: aText.AppendFormat(_L("EndRedraw()")); sl@0: break; sl@0: case EWsWinOpTestInvariant: sl@0: aText.AppendFormat(_L("__TestInvariant()")); sl@0: break; sl@0: case EWsWinOpParent: sl@0: aText.AppendFormat(_L("Parent()")); sl@0: break; sl@0: case EWsWinOpNextSibling: sl@0: aText.AppendFormat(_L("NextSibling()")); sl@0: break; sl@0: case EWsWinOpPrevSibling: sl@0: aText.AppendFormat(_L("PrevSibling()")); sl@0: break; sl@0: case EWsWinOpChild: sl@0: aText.AppendFormat(_L("Child()")); sl@0: break; sl@0: case EWsWinOpInquireOffset: sl@0: aText.AppendFormat(_L("InquireOffset(%d)"),hHandleToValue(*pData.UInt)); sl@0: break; sl@0: case EWsWinOpPointerFilter: sl@0: aText.AppendFormat(_L("PointerFilter(0x%08x)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpSetPointerCapture: sl@0: aText.AppendFormat(_L("SetPointerCapture(%u)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpSetPointerGrab: sl@0: aText.AppendFormat(_L("SetPointerGrab(%u)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpSetNoBackgroundColor: sl@0: aText.Append(_L("SetBackgroundColor()")); sl@0: break; sl@0: case EWsWinOpSetBackgroundColor: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb)); sl@0: aText.AppendFormat(_L("SetBackgroundColor(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpSetColor: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb)); sl@0: aText.AppendFormat(_L("SetColor(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpSetShadowHeight: sl@0: aText.AppendFormat(_L("SetShadowHeight(%d)"), *pData.Int); sl@0: break; sl@0: case EWsWinOpShadowDisabled: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool)); sl@0: aText.AppendFormat(_L("SetShadowDisabled(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpSetVisible: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatBool(*pData.Bool)); sl@0: aText.AppendFormat(_L("SetVisible(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpUpdateScreen: sl@0: aText.Append(_L("UpdateScreen()")); sl@0: break; sl@0: case EWsWinOpUpdateScreenRegion: sl@0: aText.Append(_L("UpdateScreenRegion(TRegion(...))")); sl@0: break; sl@0: case EWsWinOpMaintainBackup: sl@0: aText.Append(_L("MaintainBackup()")); sl@0: break; sl@0: case EWsWinOpGetInvalidRegion: sl@0: aText.Append(_L("GetInvalidRegion(...)")); sl@0: break; sl@0: case EWsWinOpGetInvalidRegionCount: sl@0: aText.Append(_L("GetInvalidRegionCount()")); sl@0: break; sl@0: case EWsWinOpScroll: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset)); sl@0: aText.AppendFormat(_L("Scroll(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpScrollClip: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset)); sl@0: aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsWinOpScrollRect: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect)); sl@0: aText.AppendFormat(_L("Scroll(%S, %S)"), &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsWinOpScrollClipRect: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ScrollRect->clip)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ScrollRect->offset)); sl@0: TLongBuf buf3(TDebugLogTextHandler::FormatRect(pData.ScrollRect->rect)); sl@0: aText.AppendFormat(_L("Scroll(%S, %S, %S)"), &buf1, &buf2, &buf3); sl@0: } sl@0: break; sl@0: case EWsWinOpBitmapHandle: sl@0: aText.Append(_L("BitmapHandle()")); sl@0: break; sl@0: case EWsWinOpUpdateBackupBitmap: sl@0: aText.Append(_L("UpdateBackupBitmap()")); sl@0: break; sl@0: case EWsWinOpRequiredDisplayMode: sl@0: aText.AppendFormat(_L("SetRequiredDisplayMode(%d)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpSetCornerType: sl@0: aText.AppendFormat(_L("SetCornerType(%d)"), *pData.UInt); sl@0: break; sl@0: case EWsWinOpSetShape: sl@0: aText.AppendFormat(_L("SetWindowShape(%d rects)"), pData.SetShape->count); sl@0: break; sl@0: case EWsWinOpSetName: sl@0: aText.Append(_L("SetName(\"...\")")); sl@0: break; sl@0: case EWsWinOpName: sl@0: aText.Append(_L("Name()")); sl@0: break; sl@0: case EWsWinOpSetOwningWindowGroup: sl@0: aText.AppendFormat(_L("SetOwningWindowGroup(%d)"),*pData.Int); sl@0: break; sl@0: case EWsWinOpDefaultOwningWindow: sl@0: aText.Append(_L("DefaultOwningWindow()")); sl@0: break; sl@0: case EWsWinOpEnableOnEvents: sl@0: aText.AppendFormat(_L("EnableOnEvents(%d)"),*pData.Int); sl@0: break; sl@0: case EWsWinOpDisableOnEvents: sl@0: aText.Append(_L("DisableOnEvents()")); sl@0: break; sl@0: case EWsWinOpEnableErrorMessages: sl@0: aText.AppendFormat(_L("EnableErrorMessages(%d)"),*pData.Int); sl@0: break; sl@0: case EWsWinOpDisableErrorMessages: sl@0: aText.Append(_L("DisableErrorMessages()")); sl@0: break; sl@0: case EWsWinOpEnableModifierChangedEvents: sl@0: aText.Append(_L("EnableModifierChangedEvents()")); sl@0: break; sl@0: case EWsWinOpDisableModifierChangedEvents: sl@0: aText.Append(_L("DisableModifierChangedEvents()")); sl@0: break; sl@0: case EWsWinOpEnableGroupChangeEvents: sl@0: aText.Append(_L("EnableGroupChangeEvents()")); sl@0: break; sl@0: case EWsWinOpDisableGroupChangeEvents: sl@0: aText.Append(_L("DisableGroupChangeEvents()")); sl@0: break; sl@0: case EWsWinOpRequestPointerRepeatEvent: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.RequestPointerRepeatEvent->rect)); sl@0: aText.AppendFormat(_L("RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(%d), %S)"), sl@0: pData.RequestPointerRepeatEvent->time.Int(), &buf); sl@0: } sl@0: break; sl@0: case EWsWinOpCancelPointerRepeatEventRequest: sl@0: aText.Append(_L("CancelPointerRepeatEventRequest()")); sl@0: break; sl@0: case EWsWinOpSetPointerCursor: sl@0: aText.AppendFormat(_L("SetPointerCursor(%d)"),*pData.UInt); sl@0: break; sl@0: case EWsWinOpSetCustomPointerCursor: sl@0: aText.AppendFormat(_L("SetCustomPointerCursor(%d)"),*pData.UInt); sl@0: break; sl@0: case EWsWinOpPasswordWindow: sl@0: aText.AppendFormat(_L("PasswordWindow(%d)"),*pData.PasswordMode); sl@0: break; sl@0: case EWsWinOpAddKeyRect: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.AddKeyRect->rect)); sl@0: aText.AppendFormat(_L("AddKeyRect(%S,%d,%d)"),&buf,pData.AddKeyRect->scanCode,pData.AddKeyRect->activatedByPointerSwitchOn); sl@0: } sl@0: break; sl@0: case EWsWinOpRemoveAllKeyRects: sl@0: aText.Append(_L("RemoveAllKeyRects()")); sl@0: break; sl@0: case EWsWinOpAllocPointerMoveBuffer: sl@0: aText.AppendFormat(_L("AllocPointerMoveBuffer(%d,%d)"),pData.AllocPointerMoveBuffer->maxNumPoints,pData.AllocPointerMoveBuffer->flags); sl@0: break; sl@0: case EWsWinOpFreePointerMoveBuffer: sl@0: aText.Append(_L("FreePointerMoveBuffer()")); sl@0: break; sl@0: case EWsWinOpEnablePointerMoveBuffer: sl@0: aText.Append(_L("EnablePointerMoveBuffer()")); sl@0: break; sl@0: case EWsWinOpDisablePointerMoveBuffer: sl@0: aText.Append(_L("DisablePointerMoveBuffer()")); sl@0: break; sl@0: case EWsWinOpRetrievePointerMoveBuffer: sl@0: aText.Append(_L("RetrievePointerMoveBuffer(...)")); sl@0: break; sl@0: case EWsWinOpDiscardPointerMoveBuffer: sl@0: aText.Append(_L("DiscardPointerMoveBuffer()")); sl@0: break; sl@0: case EWsWinOpEnableBackup: sl@0: aText.Append(_L("EnableBackup()")); sl@0: break; sl@0: case EWsWinOpClaimPointerGrab: sl@0: aText.Append(_L("ClaimPointerGrab()")); sl@0: break; sl@0: case EWsWinOpIdentifier: sl@0: aText.Append(_L("Identifier()")); sl@0: break; sl@0: case EWsWinOpSetFade: sl@0: { sl@0: _LIT(LogWinSetFade,"SetFade(%d,%d"); sl@0: aText.AppendFormat(LogWinSetFade,pData.SetFaded->Faded(),pData.SetFaded->IncludeChildren()); sl@0: if (!pData.SetFaded->UseDefaultMap()) sl@0: { sl@0: _LIT(LogWinSetFade2,",%d,%d"); sl@0: TUint8 blackMap; sl@0: TUint8 whiteMap; sl@0: pData.SetFaded->GetFadingParams(blackMap,whiteMap); sl@0: aText.AppendFormat(LogWinSetFade2,blackMap,whiteMap); sl@0: } sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsWinOpSetNonFading: sl@0: { sl@0: _LIT(LogWinSetNonFading,"SetNonFading(%d)"); sl@0: aText.AppendFormat(LogWinSetNonFading,*(pData.Bool)); sl@0: } sl@0: break; sl@0: case EWsWinOpFadeBehind: sl@0: { sl@0: _LIT(LogWinFadeBehind,"FadeBehind(%d)"); sl@0: aText.AppendFormat(LogWinFadeBehind,*(pData.Bool)); sl@0: } sl@0: break; sl@0: case EWsWinOpEnableScreenChangeEvents: sl@0: { sl@0: _LIT(LogWinEnableScreenChangeEvents,"EnableScreenChangeEvents()"); sl@0: aText.Append(LogWinEnableScreenChangeEvents); sl@0: } sl@0: break; sl@0: case EWsWinOpDisableScreenChangeEvents: sl@0: { sl@0: _LIT(LogWinDisableScreenChangeEvents,"DisableScreenChangeEvents()"); sl@0: aText.Append(LogWinDisableScreenChangeEvents); sl@0: } sl@0: break; sl@0: case EWsWinOpSendPointerEvent: sl@0: { sl@0: _LIT(LogWinSendPointerEvent,"SimulatePointerEvent("); sl@0: aText.Append(LogWinSendPointerEvent); sl@0: aText.Append(eventDetails(pData.RawEvent)); sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsWinOpSendAdvancedPointerEvent: sl@0: { sl@0: _LIT(LogWinSendPointerEvent,"SimulateAdvancedPointerEvent("); sl@0: aText.Append(LogWinSendPointerEvent); sl@0: aText.Append(eventDetails(pData.RawEvent)); sl@0: aText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case EWsWinOpGetDisplayMode: sl@0: { sl@0: _LIT(LogWinGetDisplayMode,"GetDisplayMode()"); sl@0: aText.Append(LogWinGetDisplayMode); sl@0: } sl@0: break; sl@0: case EWsWinOpGetIsFaded: sl@0: { sl@0: _LIT(LogWinIsFaded,"IsFaded()"); sl@0: aText.Append(LogWinIsFaded); sl@0: } sl@0: break; sl@0: case EWsWinOpGetIsNonFading: sl@0: { sl@0: _LIT(LogWinIsNonFading,"IsNonFading()"); sl@0: aText.Append(LogWinIsNonFading); sl@0: } sl@0: break; sl@0: case EWsWinOpOrdinalPriority: sl@0: { sl@0: _LIT(LogWinOrdinalPriority,"OrdinalPriority()"); sl@0: aText.Append(LogWinOrdinalPriority); sl@0: } sl@0: break; sl@0: case EWsWinOpClearPointerCursor: sl@0: { sl@0: _LIT(LogWinClearPointerCursor,"ClearPointerCursor()"); sl@0: aText.Append(LogWinClearPointerCursor); sl@0: } sl@0: break; sl@0: case EWsWinOpEnableGroupListChangeEvents: sl@0: { sl@0: _LIT(LogWinEnableGroupListChangeEvents,"EnableGroupListChangeEvents()"); sl@0: aText.Append(LogWinEnableGroupListChangeEvents); sl@0: } sl@0: break; sl@0: case EWsWinOpDisableGroupListChangeEvents: sl@0: { sl@0: _LIT(LogWinDisableGroupListChangeEvents,"DisableGroupListChangeEvents()"); sl@0: aText.Append(LogWinDisableGroupListChangeEvents); sl@0: } sl@0: break; sl@0: case EWsWinOpHandleTransparencyUpdate: sl@0: { sl@0: _LIT(LogWinHandleTransparencyUpdate,"HandleTransparencyUpdate()"); sl@0: aText.Append(LogWinHandleTransparencyUpdate); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTransparencyFactor: sl@0: { sl@0: _LIT(LogWinSetTransparencyFactor,"SetTransparencyFactor()"); sl@0: aText.Append(LogWinSetTransparencyFactor); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTransparencyBitmap: sl@0: { sl@0: _LIT(LogWinSetTransparencyBitmap,"SetTransparencyBitmap()"); sl@0: aText.Append(LogWinSetTransparencyBitmap); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTransparencyBitmapCWs: sl@0: { sl@0: _LIT(LogWinSetTransparencyWsBitmap,"SetTransparencyWsBitmap()"); sl@0: aText.Append(LogWinSetTransparencyWsBitmap); sl@0: } sl@0: break; sl@0: sl@0: case EWsWinOpSetTransparencyAlphaChannel: sl@0: { sl@0: _LIT(LogWinSetTransparencyAlphaChannel,"SetTransparencyAlphaChannel()"); sl@0: aText.Append(LogWinSetTransparencyAlphaChannel); sl@0: } sl@0: break; sl@0: case EWsWinOpMoveToGroup: sl@0: { sl@0: _LIT(LogWinMoveToGroup,"MoveToGroup(%d)"); sl@0: aText.AppendFormat(LogWinMoveToGroup, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsWinOpStoreDrawCommands: sl@0: { sl@0: _LIT(LogWinStoreDrawCommands,"EnableRedrawStore(%u)"); sl@0: aText.AppendFormat(LogWinStoreDrawCommands, *pData.Bool); sl@0: } sl@0: break; sl@0: case EWsWinOpSetPointerCapturePriority: sl@0: { sl@0: _LIT(LogWinSetPointerCapturePriority,"SetPointerCapturePriority(%d)"); sl@0: aText.AppendFormat(LogWinSetPointerCapturePriority, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsWinOpGetPointerCapturePriority: sl@0: { sl@0: _LIT(LogWinGetPointerCapturePriority,"GetPointerCapturePriority()"); sl@0: aText.Append(LogWinGetPointerCapturePriority); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTransparentRegion: sl@0: { sl@0: _LIT(LogWinSetTransparentRegion,"SetTransparentRegion(%d rects)"); sl@0: aText.AppendFormat(LogWinSetTransparentRegion, pData.SetShape->count); sl@0: } sl@0: break; sl@0: case EWsWinOpSetTransparencyPolicy: sl@0: { sl@0: _LIT(LogWinSetTransparentPolicy,"SetTransparencyPolicy(TransparencyPolicy= %d)"); sl@0: aText.AppendFormat(LogWinSetTransparentPolicy, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsWinOpIsRedrawStoreEnabled: sl@0: { sl@0: _LIT(LogWinIsRedrawStoreEnabled,"IsRedrawStoreEnabled()"); sl@0: aText.Append(LogWinIsRedrawStoreEnabled); sl@0: } sl@0: break; sl@0: case EWsWinOpEnableOSB: sl@0: { sl@0: _LIT(LogOSBEnabled,"EWsWinOpEnableOSB enum"); sl@0: aText.Append(LogOSBEnabled); sl@0: } sl@0: break; sl@0: case EWsWinOpDisableOSB: sl@0: { sl@0: _LIT(LogOSBDisabled,"EWsWinOpDisableOSB enum"); sl@0: aText.Append(LogOSBDisabled); sl@0: } sl@0: break; sl@0: case EWsWinOpClientHandle: sl@0: { sl@0: _LIT(LogClientHandle,"ClientHandle()"); sl@0: aText.AppendFormat(LogClientHandle); sl@0: } sl@0: break; sl@0: case EWsWinOpSetBackgroundSurface: sl@0: { sl@0: _LIT(LogWinSetBackgroundSurface,"SetBackgroundSurface(TSurfaceId{%x,%x,%x,%x})"); sl@0: aText.AppendFormat(LogWinSetBackgroundSurface, pData.Surface->iInternal[0],pData.Surface->iInternal[1],pData.Surface->iInternal[2],pData.Surface->iInternal[3]); sl@0: } sl@0: break; sl@0: case EWsWinOpKeyColor: sl@0: { sl@0: _LIT(LogWinKeyColor,"KeyColor()"); sl@0: aText.AppendFormat(LogWinKeyColor); sl@0: } sl@0: break; sl@0: case EWsWinOpSetBackgroundSurfaceConfig: sl@0: { sl@0: TSurfaceConfiguration aSurfaceConfig = pData.SurfaceConfigurationAndTrigger->surfaceConfig; sl@0: TSurfaceId surfaceid; sl@0: aSurfaceConfig.GetSurfaceId(surfaceid); sl@0: CFbsBitGc::TGraphicsOrientation orientation = aSurfaceConfig.Orientation(); sl@0: TRect extent; sl@0: aSurfaceConfig.GetExtent(extent); sl@0: TRect viewport; sl@0: aSurfaceConfig.GetViewport(viewport); sl@0: TBool flip = aSurfaceConfig.Flip(); sl@0: TBool triggerRedraw = pData.SurfaceConfigurationAndTrigger->triggerRedraw; sl@0: sl@0: TLongBuf extentbuf(TDebugLogTextHandler::FormatRect(extent)); sl@0: TLongBuf viewportbuf(TDebugLogTextHandler::FormatRect(viewport)); sl@0: sl@0: _LIT(LogWinSetBackgroundSurfaceConfig,"SetBackgroundSurface({%x,%x,%x,%x},%d,%S,%S,%d,%d)"); sl@0: aText.AppendFormat(LogWinSetBackgroundSurfaceConfig, surfaceid.iInternal[0], sl@0: surfaceid.iInternal[1], sl@0: surfaceid.iInternal[2], sl@0: surfaceid.iInternal[3], sl@0: orientation, sl@0: &extentbuf, sl@0: &viewportbuf, sl@0: flip, sl@0: triggerRedraw); sl@0: } sl@0: break; sl@0: case EWsWinOpRemoveBackgroundSurface: sl@0: { sl@0: _LIT(LogWinRemoveBackgroundSurface,"RemoveBackgroundSurface(%d)"); sl@0: aText.AppendFormat(LogWinRemoveBackgroundSurface, *(pData.Bool)); sl@0: } sl@0: break; sl@0: case EWsWinOpGetBackgroundSurfaceConfig: sl@0: { sl@0: _LIT(LogWinGetBackgroundSurfaceConfig,"GetBackgroundSurface()"); sl@0: aText.AppendFormat(LogWinGetBackgroundSurfaceConfig); sl@0: } sl@0: break; sl@0: case EWsWinOpClearRedrawStore: sl@0: { sl@0: _LIT(LogWinClearRedrawStore,"ClearRedrawStore()"); sl@0: aText.AppendFormat(LogWinClearRedrawStore); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: //#pragma check_stack(on) sl@0: void TWsDecoder::DecodeGc(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: _LIT(LogGc,"RGc[%d]::"); sl@0: aText.Format(LogGc,aHandle); sl@0: if (aOpcode &aText, TInt aOpcode, const TAny *aCmdData) sl@0: { sl@0: TWsGcCmdUnion pData; sl@0: sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsGcOpFree: sl@0: aText.AppendFormat(LogClose); sl@0: break; sl@0: case EWsGcOpActivate: sl@0: { sl@0: _LIT(LogGcActivate,"Activate(%d)"); sl@0: aText.AppendFormat(LogGcActivate,hHandleToValue(*pData.UInt)); sl@0: } sl@0: break; sl@0: case EWsGcOpDeactivate: sl@0: { sl@0: _LIT(LogGcDeactivate,"Deactivate()"); sl@0: aText.AppendFormat(LogGcDeactivate); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawLine: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt1)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.DrawLine->pnt2)); sl@0: _LIT(LogGcDrawLine,"DrawLine(%S, %S)"); sl@0: aText.AppendFormat(LogGcDrawLine, &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsGcOpSetBrushStyle: sl@0: { sl@0: _LIT(LogGcSetBrushStyle,"SetBrushStyle(%u)"); sl@0: aText.AppendFormat(LogGcSetBrushStyle,*pData.UInt); sl@0: } sl@0: break; sl@0: case EWsGcOpPlot: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcPlot,"Plot(%S)"); sl@0: aText.AppendFormat(LogGcPlot, &buf); sl@0: } sl@0: break; sl@0: case EWsGcOpSetPenColor: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb)); sl@0: _LIT(LogGcSetPenColor,"SetPenColor(%S)"); sl@0: aText.AppendFormat(LogGcSetPenColor,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpSetBrushColor: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRgb(*pData.rgb)); sl@0: _LIT(LogGcSetBrushColor,"SetBrushColor(%S)"); sl@0: aText.AppendFormat(LogGcSetBrushColor,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpSetPenSize: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcSetPenSize,"SetPenSize(%S)"); sl@0: aText.AppendFormat(LogGcSetPenSize,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpSetPenStyle: sl@0: { sl@0: _LIT(LogGcSetPenStyle,"SetPenStyle(%d)"); sl@0: aText.AppendFormat(LogGcSetPenStyle,*pData.UInt); sl@0: } sl@0: break; sl@0: case EWsGcOpSetClippingRegion: sl@0: { sl@0: _LIT(LogGcSetClippingRegion,"SetClippingRegion(...)"); sl@0: aText.Append(LogGcSetClippingRegion); sl@0: } sl@0: break; sl@0: case EWsGcOpCancelClippingRegion: sl@0: { sl@0: _LIT(LogGcCancelClippingRegion,"CancelClippingRegion()"); sl@0: aText.Append(LogGcCancelClippingRegion); sl@0: } sl@0: break; sl@0: case EWsGcOpSetClippingRect: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect)); sl@0: _LIT(LogGcSetClippingRect,"SetClippingRect(%S)"); sl@0: aText.AppendFormat(LogGcSetClippingRect,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpCancelClippingRect: sl@0: { sl@0: _LIT(LogGcCancelClippingRect,"CancelClippingRect()"); sl@0: aText.Append(LogGcCancelClippingRect); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawTo: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcDrawTo,"DrawTo(%S)"); sl@0: aText.AppendFormat(LogGcDrawTo,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBy: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcDrawBy,"DrawBy(%S)"); sl@0: aText.AppendFormat(LogGcDrawBy,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawPolyLine: sl@0: { sl@0: _LIT(LogGcDrawPolyLine,"DrawPolyLine(%d...)"); sl@0: aText.AppendFormat(LogGcDrawPolyLine,pData.PolyLine->numPoints); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawPolyLineContinued: sl@0: { sl@0: _LIT(LogGcDrawPolyLineContinued,"DrawPolyLineContinued(%d...)"); sl@0: aText.AppendFormat(LogGcDrawPolyLineContinued,pData.PolyLine->numPoints); sl@0: } sl@0: break; sl@0: case EWsGcOpUseBrushPattern: sl@0: { sl@0: _LIT(LogGcUseBrushPattern,"UseBrushPattern({0x%x})"); sl@0: aText.AppendFormat(LogGcUseBrushPattern,hHandleToValue(*pData.handle)); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawArc: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start)); sl@0: TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end)); sl@0: _LIT(LogGcDrawArc,"DrawArc(%S,%S,%S)"); sl@0: aText.AppendFormat(LogGcDrawArc,&buf1,&buf2,&buf3); sl@0: } sl@0: break; sl@0: case EWsGcOpSetWordJustification: sl@0: { sl@0: _LIT(LogGcSetWordJustification,"SetWordJustification(%d,%d)"); sl@0: aText.AppendFormat(LogGcSetWordJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps); sl@0: } sl@0: break; sl@0: case EWsGcOpSetCharJustification: sl@0: { sl@0: _LIT(LogGcSetCharJustification,"SetCharJustification(%d,%d)"); sl@0: aText.AppendFormat(LogGcSetCharJustification,pData.SetJustification->excessWidth,pData.SetJustification->numGaps); sl@0: } sl@0: break; sl@0: case EWsGcOpSetBrushOrigin: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: aText.AppendFormat(_L("SetBrushOrigin(%S)"), &buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDiscardBrushPattern: sl@0: { sl@0: _LIT(LogGcDiscardBrushPattern,"DiscardBrushPattern()"); sl@0: aText.Append(LogGcDiscardBrushPattern); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeGc2(TBuf &aText, TInt aOpcode, const TAny *aCmdData) sl@0: { sl@0: TWsGcCmdUnion pData; sl@0: sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsGcOpDrawText: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos)); sl@0: _LIT(LogGcDrawText1,"DrawText(\""); sl@0: TDebugLogTextHandler::Append(aText, LogGcDrawText1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawText+1), pData.DrawText->length)); sl@0: _LIT(LogGcDrawText2,"\", %S)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawTextVertical: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos)); sl@0: _LIT(LogGcDrawTextVertical1,"DrawTextVertical(\""); sl@0: TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawTextVertical+1), pData.DrawTextVertical->length)); sl@0: _LIT(LogGcDrawTextVertical2,"\", %S, %d)"); sl@0: aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawTextVerticalPtr: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawTextVertical->pos)); sl@0: _LIT(LogGcDrawTextVertical1,"DrawTextVertical(..."); sl@0: TDebugLogTextHandler::Append(aText, LogGcDrawTextVertical1); sl@0: _LIT(LogGcDrawTextVertical2,", %S, %d)"); sl@0: aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf,pData.DrawTextVertical->up); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawTextPtr: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.DrawText->pos)); sl@0: _LIT(LogGcDrawText1,"DrawText(..."); sl@0: TDebugLogTextHandler::Append(aText, LogGcDrawText1); sl@0: _LIT(LogGcDrawText2,",%S)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxTextOptimised1: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO1->box)); sl@0: _LIT(LogGcDrawText1,"DrawText(\""); sl@0: aText.Append(LogGcDrawText1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO1+1), pData.BoxTextO1->length)); sl@0: _LIT(LogGcDrawText2,"\", %S, %d, %d, 0)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, sl@0: pData.BoxTextO1->baselineOffset,CGraphicsContext::ELeft); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxTextOptimised2: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxTextO2->box)); sl@0: _LIT(LogGcDrawText1,"DrawText(\""); sl@0: aText.Append(LogGcDrawText1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxTextO2+1), pData.BoxTextO2->length)); sl@0: _LIT(LogGcDrawText2,"\", %S, %d, %d, %d)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxTextO2->baselineOffset, sl@0: pData.BoxTextO2->horiz, pData.BoxTextO2->leftMrg); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxTextVertical: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box)); sl@0: _LIT(LogGcDrawTextVertical1,"DrawTextVertical(\""); sl@0: aText.Append(LogGcDrawTextVertical1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.DrawBoxTextVertical+1), pData.DrawBoxTextVertical->length)); sl@0: _LIT(LogGcDrawTextVertical2,"\", %S, %d, %d, %d, %d)"); sl@0: aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler, &buf, sl@0: pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up, sl@0: pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxTextPtr: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box)); sl@0: _LIT(LogGcDrawText1,"DrawText(..."); sl@0: TDebugLogTextHandler::Append(aText, LogGcDrawText1); sl@0: _LIT(LogGcDrawText2,", %S, %d, %d, %d)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset, sl@0: pData.BoxText->horiz, pData.BoxText->leftMrg); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxTextVerticalPtr: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.DrawBoxTextVertical->box)); sl@0: _LIT(LogGcDrawTextVertical1,"DrawTextVertical(..."); sl@0: aText.Append(LogGcDrawTextVertical1); sl@0: _LIT(LogGcDrawTextVertical2,", %S, %d, %d, %d, %d)"); sl@0: aText.AppendFormat(LogGcDrawTextVertical2,&iOverflowHandler,&buf, sl@0: pData.DrawBoxTextVertical->baselineOffset, pData.DrawBoxTextVertical->up, sl@0: pData.DrawBoxTextVertical->vert, pData.DrawBoxTextVertical->margin); sl@0: } sl@0: break; sl@0: case EWsGcOpCopyRect: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.CopyRect->pos)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.CopyRect->rect)); sl@0: _LIT(LogGcCopyRect,"CopyRect(%S, %S)"); sl@0: aText.AppendFormat(LogGcCopyRect,&buf1,&buf2); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawEllipse: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect)); sl@0: _LIT(LogGcDrawEllipse,"DrawEllipse(%S)"); sl@0: aText.AppendFormat(LogGcDrawEllipse,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpMoveTo: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcMoveTo,"MoveTo(%S)"); sl@0: aText.AppendFormat(LogGcMoveTo,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpMoveBy: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcMoveBy,"MoveBy(%S)"); sl@0: aText.AppendFormat(LogGcMoveBy,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawPolygon: sl@0: { sl@0: _LIT(LogGcDrawPolygon,"DrawPolygon(...)"); sl@0: aText.Append(LogGcDrawPolygon); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawRoundRect: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RoundRect->rect)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.RoundRect->ellipse)); sl@0: _LIT(LogGcDrawRoundRect,"DrawRoundRect(%S,%S)"); sl@0: aText.AppendFormat(LogGcDrawRoundRect,&buf1,&buf2); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawPie: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.ArcOrPie->rect)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->start)); sl@0: TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.ArcOrPie->end)); sl@0: _LIT(LogGcDrawPie,"DrawPie(%S,%S,%S)"); sl@0: aText.AppendFormat(LogGcDrawPie,&buf1,&buf2,&buf3); sl@0: } sl@0: break; sl@0: case EWsGcOpSetOrigin: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcSetOrigin,"SetOrigin(%S)"); sl@0: aText.AppendFormat(LogGcSetOrigin,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpStartSegmentedDrawPolygon: sl@0: { sl@0: _LIT(LogGcStartSegmentedDrawPolygon,"StartSegmentedDrawPolygon(%d)"); sl@0: aText.AppendFormat(LogGcStartSegmentedDrawPolygon,*pData.StartSegmentedDrawPolygon); sl@0: } sl@0: break; sl@0: case EWsGcOpSegmentedDrawPolygonData: sl@0: { sl@0: _LIT(LogGcSegmentedDrawPolygonData,"SegmentedDrawPolygonData(%d,%d,...)"); sl@0: aText.AppendFormat(LogGcSegmentedDrawPolygonData,pData.SegmentedDrawPolygonData->index, sl@0: pData.SegmentedDrawPolygonData->numPoints); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawSegmentedPolygon: sl@0: { sl@0: _LIT(LogGcDrawSegmentedPolygon,"DrawSegmentedPolygon()"); sl@0: aText.AppendFormat(LogGcDrawSegmentedPolygon); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawRect: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect)); sl@0: _LIT(LogGcDrawRect,"DrawRect(%S)"); sl@0: aText.AppendFormat(LogGcDrawRect,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBitmap: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.Bitmap->pos)); sl@0: _LIT(KLitGcDrawBitmap, "DrawBitmap({%d}, %S)"); sl@0: aText.AppendFormat(KLitGcDrawBitmap, hHandleToValue(pData.Bitmap->handle), &buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBitmap2: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.Bitmap2->rect)); sl@0: _LIT(KLitGcDrawBitmap2, "DrawBitmap2({%d}, %S)"); sl@0: aText.AppendFormat(KLitGcDrawBitmap2, hHandleToValue(pData.Bitmap2->handle), &buf); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBitmap3: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.Bitmap3->rect)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.Bitmap3->srcRect)); sl@0: _LIT(KLitGcDrawBitmap3, "DrawBitmap3({%d}, %S, %S)"); sl@0: aText.AppendFormat(KLitGcDrawBitmap3, hHandleToValue(pData.Bitmap3->handle), &buf1, &buf2); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBitmapMasked: sl@0: case EWsGcOpWsDrawBitmapMasked: sl@0: { sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iRect)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.iBitmapMasked->iSrcRect)); sl@0: _LIT(KLitGcDrawBitmapMasked, "DrawBitmapMasked(%S, {%d}, %S, {%d}, %d)"); sl@0: aText.AppendFormat(KLitGcDrawBitmapMasked, &buf1, hHandleToValue(pData.iBitmapMasked->iHandle), sl@0: &buf2, hHandleToValue(pData.iBitmapMasked->iMaskHandle), pData.iBitmapMasked->iInvertMask); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawBoxText: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.BoxText->box)); sl@0: _LIT(LogGcDrawText1,"DrawText(\""); sl@0: aText.Append(LogGcDrawText1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.BoxText+1), pData.BoxText->length)); sl@0: _LIT(LogGcDrawText2,"\", %S, %d, %d, %d)"); sl@0: aText.AppendFormat(LogGcDrawText2,&iOverflowHandler, &buf, pData.BoxText->baselineOffset, sl@0: pData.BoxText->horiz, pData.BoxText->leftMrg); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeGc3(TBuf &aText, TInt aOpcode, const TAny *aCmdData) sl@0: { sl@0: TWsGcCmdUnion pData; sl@0: sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsGcOpSetDrawMode: sl@0: { sl@0: _LIT(LogGcSetDrawMode,"SetDrawMode(%u)"); sl@0: aText.AppendFormat(LogGcSetDrawMode,*pData.UInt); sl@0: } sl@0: break; sl@0: case EWsGcOpClearRect: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(*pData.Rect)); sl@0: _LIT(LogGcClear,"Clear(%S)"); sl@0: aText.AppendFormat(LogGcClear, &buf); sl@0: } sl@0: break; sl@0: case EWsGcOpClear: sl@0: { sl@0: _LIT(LogGcClear,"Clear()"); sl@0: aText.AppendFormat(LogGcClear); sl@0: } sl@0: break; sl@0: case EWsGcOpGdiBlt2: sl@0: case EWsGcOpGdiWsBlt2: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GdiBlt2->pos)); sl@0: _LIT(LogGcGdiBlt,"GdiBlt(%S, {%d})"); sl@0: aText.AppendFormat(LogGcGdiBlt,&buf,hHandleToValue(pData.GdiBlt2->handle)); sl@0: } sl@0: break; sl@0: case EWsGcOpGdiBlt3: sl@0: case EWsGcOpGdiWsBlt3: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBlt3->pos)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBlt3->rect)); sl@0: _LIT(LogGcGdiBlt,"GdiBlt(%S, {%d}, %S)"); sl@0: aText.AppendFormat(LogGcGdiBlt,&buf1,hHandleToValue(pData.GdiBlt3->handle),&buf2); sl@0: } sl@0: break; sl@0: case EWsGcOpGdiBltMasked: sl@0: case EWsGcOpGdiWsBltMasked: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.GdiBltMasked->destination)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.GdiBltMasked->source)); sl@0: _LIT(LogGcBitBltMasked,"BitBltMasked(%S, {%d}, %S, {%d}, %d)"); sl@0: aText.AppendFormat(LogGcBitBltMasked, &buf1, hHandleToValue(pData.GdiBltMasked->handle), sl@0: &buf2, hHandleToValue(pData.GdiBltMasked->maskHandle), sl@0: pData.GdiBltMasked->invertMask); sl@0: } sl@0: break; sl@0: case EWsGcOpSize: sl@0: { sl@0: _LIT(LogGcSize,"Size()"); sl@0: aText.AppendFormat(LogGcSize); sl@0: } sl@0: break; sl@0: case EWsGcOpUseFont: sl@0: { sl@0: _LIT(LogGcUseFont,"UseFont({0x%x})"); sl@0: aText.AppendFormat(LogGcUseFont,hHandleToValue(*pData.handle)); sl@0: } sl@0: break; sl@0: case EWsGcOpDiscardFont: sl@0: { sl@0: _LIT(LogGcDiscardFont,"DiscardFont()"); sl@0: aText.AppendFormat(LogGcDiscardFont); sl@0: } sl@0: break; sl@0: case EWsGcOpTestInvariant: sl@0: { sl@0: _LIT(LogGcTestInvariant,"unimplemented opcode 'EWsGcOpTestInvariant' (%u)"); sl@0: aText.AppendFormat(LogGcTestInvariant, aOpcode); sl@0: } sl@0: break; sl@0: case EWsGcOpReset: sl@0: { sl@0: _LIT(LogGcReset,"Reset()"); sl@0: aText.Append(LogGcReset); sl@0: } sl@0: break; sl@0: case EWsGcOpSetDitherOrigin: sl@0: { sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: _LIT(LogGcSetDitherOrigin,"SetDitherOrigin(%S)"); sl@0: aText.AppendFormat(LogGcSetDitherOrigin,&buf); sl@0: } sl@0: break; sl@0: case EWsGcOpMapColors: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.MapColors->rect)); sl@0: _LIT(LogGcMapColors,"MapColors(%S,?,%d)"); sl@0: aText.AppendFormat(LogGcMapColors,&buf,pData.MapColors->numPairs); sl@0: } sl@0: break; sl@0: case EWsGcOpSetUnderlineStyle: sl@0: { sl@0: _LIT(LogGcSetUnderlineStyle,"SetUnderlineStyle(%x)"); sl@0: aText.AppendFormat(LogGcSetUnderlineStyle,*pData.SetUnderlineStyle); sl@0: } sl@0: break; sl@0: case EWsGcOpSetStrikethroughStyle: sl@0: { sl@0: _LIT(LogGcSetStrikethroughStyle,"SetStrikethroughStyle(%x)"); sl@0: aText.AppendFormat(LogGcSetStrikethroughStyle,*pData.SetStrikethroughStyle); sl@0: } sl@0: break; sl@0: case EWsGcOpDrawWsGraphic: sl@0: case EWsGcOpDrawWsGraphicPtr: sl@0: { sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.WsGraphic->iRect)); sl@0: _LIT(KLitGcDrawWsGraphic,"DrawWsGraphic(%x, %d, %S, %d)"); sl@0: aText.AppendFormat(KLitGcDrawWsGraphic, pData.WsGraphic->iFlags, pData.WsGraphic->iId, &buf, pData.WsGraphic->iDataLen); sl@0: } sl@0: break; sl@0: case EWsGcOpSetFaded: sl@0: { sl@0: _LIT(KLitGcSetFaded, "SetFaded(%d)"); sl@0: aText.AppendFormat(KLitGcSetFaded, *pData.Bool); sl@0: } sl@0: break; sl@0: case EWsGcOpSetFadeParams: sl@0: { sl@0: _LIT(KLitGcSetFadeParams, "SetFadeParams(BlackMap %d, WhiteMap %d)"); sl@0: const unsigned char *bytePtr = (const unsigned char*)(pData.UInt); sl@0: aText.AppendFormat(KLitGcSetFadeParams, bytePtr[0], bytePtr[1]); sl@0: } sl@0: break; sl@0: case EWsGcOpGdiAlphaBlendBitmaps: sl@0: case EWsGcOpGdiWsAlphaBlendBitmaps: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->point)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.AlphaBlendBitmaps->source)); sl@0: TShortBuf buf3(TDebugLogTextHandler::FormatPoint(pData.AlphaBlendBitmaps->alphaPoint)); sl@0: _LIT(KLitGcAlphaBlendBitmaps,"AlphaBlendBitmaps(%S, {%d}, %S, {%d}, %S)"); sl@0: aText.AppendFormat(KLitGcAlphaBlendBitmaps, &buf1, hHandleToValue(pData.AlphaBlendBitmaps->bitmapHandle), sl@0: &buf2, hHandleToValue(pData.AlphaBlendBitmaps->alphaHandle), sl@0: &buf3); sl@0: } sl@0: break; sl@0: case EWsGcOpSetOpaque: sl@0: { sl@0: _LIT(KLitGcOpSetOpaque, "SetOpaque(%d)"); sl@0: aText.AppendFormat(KLitGcOpSetOpaque, *pData.Bool); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeScreenDevice(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TWsSdCmdUnion pData; sl@0: _LIT(LogScreenDevice,"CWsScreenDevice[%d]::"); sl@0: sl@0: aText.Format(LogScreenDevice,aHandle); sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsSdOpFree: sl@0: { sl@0: _LIT(LogScreenDeviceDelete,"~CWsScreenDevice()"); sl@0: aText.Append(LogScreenDeviceDelete); sl@0: } sl@0: break; sl@0: case EWsSdOpPixel: sl@0: { sl@0: _LIT(LogScreenDevicePixel,"Pixel(%S)"); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(*pData.Point)); sl@0: aText.AppendFormat(LogScreenDevicePixel,&buf); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScanLine: sl@0: { //This fills up the log two much for test code sl@0: aText=KNullDesC; sl@0: /*_LIT(LogScreenDeviceGetScanLine,"GetScanLine(TRgb *aScanLine, %d, %S)"); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(pData.GetScanLine->pos)); sl@0: aText.AppendFormat(LogScreenDeviceGetScanLine,pData.GetScanLine->len,&buf);*/ sl@0: } sl@0: break; sl@0: case EWsSdOpHorizontalTwipsToPixels: sl@0: { sl@0: _LIT(LogScreenDeviceHorizontalTwipsToPixels,"HorizontalTwipsToPixels()"); sl@0: aText.Append(LogScreenDeviceHorizontalTwipsToPixels); sl@0: } sl@0: break; sl@0: case EWsSdOpVerticalTwipsToPixels: sl@0: { sl@0: _LIT(LogScreenDeviceVerticalTwipsToPixels,"VerticalTwipsToPixels()"); sl@0: aText.Append(LogScreenDeviceVerticalTwipsToPixels); sl@0: } sl@0: break; sl@0: case EWsSdOpHorizontalPixelsToTwips: sl@0: { sl@0: _LIT(LogScreenDeviceHorizontalPixelsToTwips,"HorizontalPixelsToTwips()"); sl@0: aText.Append(LogScreenDeviceHorizontalPixelsToTwips); sl@0: } sl@0: break; sl@0: case EWsSdOpVerticalPixelsToTwips: sl@0: { sl@0: _LIT(LogScreenDeviceVerticalPixelsToTwips,"VerticalPixelsToTwips()"); sl@0: aText.Append(LogScreenDeviceVerticalPixelsToTwips); sl@0: } sl@0: break; sl@0: case EWsSdOpPixelSize: sl@0: { sl@0: _LIT(LogScreenDeviceSizeInPixels,"SizeInPixels()"); sl@0: aText.Append(LogScreenDeviceSizeInPixels); sl@0: } sl@0: break; sl@0: case EWsSdOpTwipsSize: sl@0: { sl@0: _LIT(LogScreenDeviceSizeInTwips,"SizeInTwips()"); sl@0: aText.Append(LogScreenDeviceSizeInTwips); sl@0: } sl@0: break; sl@0: case EWsSdOpDisplayMode: sl@0: { sl@0: _LIT(LogScreenDeviceDisplayMode,"DisplayMode()"); sl@0: aText.Append(LogScreenDeviceDisplayMode); sl@0: } sl@0: break; sl@0: case EWsSdOpRectCompare: sl@0: { sl@0: _LIT(LogScreenDeviceRectCompare,"RectCompare(%S, %S)"); sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect1)); sl@0: TLongBuf buf2(TDebugLogTextHandler::FormatRect(pData.RectCompare->rect2)); sl@0: aText.AppendFormat(LogScreenDeviceRectCompare,&buf1,&buf2); sl@0: } sl@0: break; sl@0: case EWsSdOpPointerRect: sl@0: { sl@0: _LIT(LogScreenDevicePointerRect,"PointerRect()"); sl@0: aText.Append(LogScreenDevicePointerRect); sl@0: } sl@0: break; sl@0: case EWsSdOpCopyScreenToBitmap: sl@0: { sl@0: _LIT(LogScreenDeviceCopyScreenToBitmap,"CopyScreenToBitmap(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap,pData.CopyScreenToBitmap->handle); sl@0: } sl@0: break; sl@0: case EWsSdOpCopyScreenToBitmap2: sl@0: { sl@0: _LIT(LogScreenDeviceCopyScreenToBitmap2,"CopyScreenToBitmap(%d,%S)"); sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(pData.CopyScreenToBitmap2->rect)); sl@0: aText.AppendFormat(LogScreenDeviceCopyScreenToBitmap2,pData.CopyScreenToBitmap2->handle,&buf); sl@0: } sl@0: break; sl@0: case EWsSdOpSetScreenSizeAndRotation: sl@0: { sl@0: _LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %S, %d})"); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iPixelSize)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatSize(pData.PixelsTwipsAndRotation->iTwipsSize)); sl@0: aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf1,&buf2,pData.PixelsTwipsAndRotation->iRotation); sl@0: } sl@0: break; sl@0: case EWsSdOpSetScreenSizeAndRotation2: sl@0: { sl@0: _LIT(LogScreenDeviceSetScreenSizeAndRotation,"SetScreenSizeAndRotation({%S, %d})"); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.PixelsAndRotation->iPixelSize)); sl@0: aText.AppendFormat(LogScreenDeviceSetScreenSizeAndRotation,&buf,pData.PixelsAndRotation->iRotation); sl@0: } sl@0: break; sl@0: case EWsSdOpGetDefaultScreenSizeAndRotation: sl@0: case EWsSdOpGetDefaultScreenSizeAndRotation2: sl@0: { sl@0: _LIT(LogScreenDeviceGetDefaultScreenSizeAndRotation,"GetDefaultScreenSizeAndRotation(...)"); sl@0: aText.Append(LogScreenDeviceGetDefaultScreenSizeAndRotation); sl@0: } sl@0: break; sl@0: case EWsSdOpGetNumScreenModes: sl@0: { sl@0: _LIT(LogScreenDeviceNumScreenModes,"NumScreenModes"); sl@0: aText.Append(LogScreenDeviceNumScreenModes); sl@0: } sl@0: break; sl@0: case EWsSdOpSetScreenMode: sl@0: { sl@0: _LIT(LogScreenDeviceSetScreenMode,"ScreenMode(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceSetScreenMode,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeSizeAndRotation: sl@0: case EWsSdOpGetScreenModeSizeAndRotation2: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenModeSizeAndRotation,"GetScreenModeSizeAndRotation(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetScreenModeSizeAndRotation,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpSetScreenModeEnforcement: sl@0: { sl@0: _LIT(LogScreenDeviceSetScreenModeEnforcement,"SetScreenModeEnforcement(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceSetScreenModeEnforcement,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpScreenModeEnforcement: sl@0: { sl@0: _LIT(LogScreenDeviceScreenModeEnforcement,"ScreenModeEnforcement"); sl@0: aText.Append(LogScreenDeviceScreenModeEnforcement); sl@0: } sl@0: break; sl@0: case EWsSdOpSetModeRotation: sl@0: { sl@0: _LIT(LogScreenDeviceSetModeRotation,"SetModeRotation(%d,%d)"); sl@0: aText.AppendFormat(LogScreenDeviceSetModeRotation,pData.SetScreenRotation->mode,pData.SetScreenRotation->rotation); sl@0: } sl@0: break; sl@0: case EWsSdOpGetRotationList: sl@0: { sl@0: _LIT(LogScreenDeviceGetRotationList,"GetRotationList(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetRotationList,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpPaletteAttributes: sl@0: { sl@0: _LIT(LogScreenDevicePaletteAttributes,"PaletteAttributes(...)"); sl@0: aText.Append(LogScreenDevicePaletteAttributes); sl@0: } sl@0: break; sl@0: case EWsSdOpSetPalette: sl@0: { sl@0: _LIT(LogScreenDeviceSetPalette,"SetPalette(...)"); sl@0: aText.Append(LogScreenDeviceSetPalette); sl@0: } sl@0: break; sl@0: case EWsSdOpGetPalette: sl@0: { sl@0: _LIT(LogScreenDeviceGetPalette,"GetPalette()"); sl@0: aText.Append(LogScreenDeviceGetPalette); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenMode: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenMode,"CurrentScreenMode()"); sl@0: aText.Append(LogScreenDeviceGetScreenMode); sl@0: } sl@0: break; sl@0: case EWsSdOpGetDefaultScreenModeOrigin: sl@0: { sl@0: _LIT(LogScreenDeviceGetDefaultScreenModeOrigin,"GetDefaultScreenModeOrigin()"); sl@0: aText.Append(LogScreenDeviceGetDefaultScreenModeOrigin); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeOrigin: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenModeOrigin,"GetScreenModeOrigin(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetScreenModeOrigin, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeScale: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenModeScale,"GetScreenModeScale(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetScreenModeScale, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpGetCurrentScreenModeScale: sl@0: { sl@0: _LIT(LogScreenDeviceGetCurrentScreenModeScale,"GetCurrentScreenModeScale()"); sl@0: aText.Append(LogScreenDeviceGetCurrentScreenModeScale); sl@0: } sl@0: break; sl@0: case EWsSdOpSetAppScreenMode: sl@0: { sl@0: _LIT(LogScreenDeviceSetAppScreenMode,"SetAppScreenMode(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceSetAppScreenMode, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeScaledOrigin: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenModeScaledOrigin,"GetScreenModeScaledOrigin(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetScreenModeScaledOrigin, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsSdOpGetCurrentScreenModeScaledOrigin: sl@0: { sl@0: _LIT(LogScreenDeviceGetCurrentScreenModeScaledOrigin,"GetCurrentScreenModeScaledOrigin()"); sl@0: aText.Append(LogScreenDeviceGetCurrentScreenModeScaledOrigin); sl@0: } sl@0: break; sl@0: case EWsSdOpSetCurrentScreenModeAttributes: sl@0: { sl@0: _LIT(LogScreenDeviceSetCurrentScreenModeAttributes,"SetCurrentScreenModeAttributes(%S)"); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatSize(pData.ScreenSizeMode->iScreenSize)); sl@0: aText.AppendFormat(LogScreenDeviceSetCurrentScreenModeAttributes,&buf); sl@0: } sl@0: break; sl@0: case EWsSdOpGetCurrentScreenModeAttributes: sl@0: { sl@0: _LIT(LogScreenDeviceGetCurrentScreenModeOrigin,"GetCurrentScreenModeAttributes()"); sl@0: aText.Append(LogScreenDeviceGetCurrentScreenModeOrigin); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenNumber: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenNumber,"GetScreenNumber()"); sl@0: aText.Append(LogScreenDeviceGetScreenNumber); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenSizeModeList: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenSizeModeList,"GetScreenSizeModeList(RArray* aModeList)"); sl@0: aText.Append(LogScreenDeviceGetScreenSizeModeList); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeDisplayMode: sl@0: { sl@0: _LIT(LogScreenDeviceGetScreenModeDisplayMode,"GetScreenModeDisplayMode(%d)"); sl@0: aText.AppendFormat(LogScreenDeviceGetScreenModeDisplayMode, *pData.Int); sl@0: } sl@0: break; sl@0: case EWsClOpSetBackLight: sl@0: { sl@0: _LIT(LogScreenDeviceSetBackLight,"SetBackLight(%u)"); sl@0: aText.AppendFormat(LogScreenDeviceSetBackLight, *pData.UInt); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeAnimDll(TBuf& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle) sl@0: { sl@0: aText.Format(_L("CAnimDll[%d]::"),aHandle); sl@0: switch (aOpcode) sl@0: { sl@0: case EWsAnimDllOpCreateInstance: sl@0: TDebugLogTextHandler::Append(aText, _L("CreateInstance(...)")); sl@0: break; sl@0: case EWsAnimDllOpDestroyInstance: sl@0: TDebugLogTextHandler::Append(aText, LogClose); sl@0: break; sl@0: case EWsAnimDllOpCommandReply: sl@0: TDebugLogTextHandler::Append(aText, _L("CommandReply(...)")); sl@0: break; sl@0: case EWsAnimDllOpCommand: sl@0: TDebugLogTextHandler::Append(aText, _L("Command(...)")); sl@0: break; sl@0: case EWsAnimDllOpFree: sl@0: aText.Append(_L("~CAnimDll()")); sl@0: break; sl@0: case EWsAnimDllOpCreateInstanceSprite: sl@0: aText.Append(_L("EWsAnimDllOpCreateInstanceSprite enum")); sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeSpriteBase(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TWsSpriteCmdUnion pData; sl@0: sl@0: aText.Format(_L("RWsSpriteBase[%d]::"),aHandle); sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsSpriteOpFree: sl@0: aText.Append(LogClose); sl@0: break; sl@0: case EWsSpriteOpSetPosition: sl@0: aText.Append(_L("SetPosition(...)")); sl@0: break; sl@0: case EWsSpriteOpUpdateMember: sl@0: aText.AppendFormat(_L("UpdateMember(%d)"),pData.UpdateMember->index); sl@0: break; sl@0: case EWsSpriteOpUpdateMember2: sl@0: aText.AppendFormat(_L("UpdateMember(%d,{%d,%d,%d,%d,{%d,%d},%d})"),pData.UpdateMember->index, sl@0: pData.UpdateMember->data.iBitmap,pData.UpdateMember->data.iMaskBitmap, sl@0: pData.UpdateMember->data.iInvertMask,pData.UpdateMember->data.iDrawMode, sl@0: pData.UpdateMember->data.iOffset.iX,pData.UpdateMember->data.iOffset.iY, sl@0: pData.UpdateMember->data.iInterval.Int()); sl@0: break; sl@0: case EWsSpriteOpAppendMember: sl@0: aText.Append(_L("AppendMember(...)")); sl@0: break; sl@0: case EWsSpriteOpActivate: sl@0: aText.Append(_L("Activate()")); sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeBitmap(TBuf& aText,TInt aOpcode,const TAny* /*aCmdData*/,TInt aHandle) sl@0: { sl@0: aText.Format(_L("CWsBitmap[%d]::"),aHandle); sl@0: switch (aOpcode) sl@0: { sl@0: case EWsBitmapOpFree: sl@0: aText.Append(LogClose); sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeDirect(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TWsDirectCmdUnion pData; sl@0: sl@0: _LIT(KClassName,"RDirectScreenAccess[%d]::"); sl@0: aText.Format(KClassName,aHandle); sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsDirectOpFree: sl@0: aText.Append(LogClose); sl@0: break; sl@0: case EWsDirectOpRequest: sl@0: { sl@0: _LIT(LogDirectRequest,"Request(TInt *stat,%d)"); sl@0: aText.AppendFormat(LogDirectRequest,hHandleToValue(*pData.Int)); sl@0: } sl@0: break; sl@0: case EWsDirectOpInitFailed: sl@0: { sl@0: _LIT(LogDirectInitFailed,"InitFailed()"); sl@0: aText.Append(LogDirectInitFailed); sl@0: } sl@0: break; sl@0: case EWsDirectOpGetRegion: sl@0: { sl@0: _LIT(LogDirectGetRegion,"GetRegion(%d)"); sl@0: aText.AppendFormat(LogDirectGetRegion,*pData.Int); sl@0: } sl@0: break; sl@0: case EWsDirectOpCancel: sl@0: { sl@0: _LIT(LogDirectCancel,"Cancel()"); sl@0: aText.Append(LogDirectCancel); sl@0: } sl@0: break; sl@0: case EWsDirectOpGetSendQueue: sl@0: { sl@0: _LIT(LogGetSendQueue,"EWsDirectOpGetSendQueue enum"); sl@0: aText.Append(LogGetSendQueue); sl@0: } sl@0: break; sl@0: case EWsDirectOpGetRecQueue: sl@0: { sl@0: _LIT(LogGetRecQueue,"EWsDirectOpGetRecQueue enum"); sl@0: aText.Append(LogGetRecQueue); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::DecodeClick(TBuf &aText, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: TWsClickCmdUnion pData; sl@0: sl@0: _LIT(KClassName,"RSoundPlugIn[%d]::"); sl@0: aText.Format(KClassName,aHandle); sl@0: pData.any=aCmdData; sl@0: switch (aOpcode) sl@0: { sl@0: case EWsClickOpFree: sl@0: aText.Append(LogClose); sl@0: break; sl@0: case EWsClickOpIsLoaded: sl@0: { sl@0: _LIT(LogClickIsLoaded,"IsLoaded()"); sl@0: aText.Append(LogClickIsLoaded); sl@0: } sl@0: break; sl@0: case EWsClickOpUnLoad: sl@0: { sl@0: _LIT(LogClickUnLoad,"UnLoad()"); sl@0: aText.Append(LogClickUnLoad); sl@0: } sl@0: break; sl@0: case EWsClickOpLoad: sl@0: { sl@0: _LIT(LogClickLoad1,"Load(\""); sl@0: _LIT(LogClickLoad2,"\")"); sl@0: TDebugLogTextHandler::Append(aText, LogClickLoad1); sl@0: TDebugLogTextHandler::Append(aText, TPtrC((TText *)(pData.Int+1), *pData.Int)); sl@0: TDebugLogTextHandler::Append(aText, LogClickLoad2); sl@0: } sl@0: break; sl@0: case EWsClickOpCommandReply: sl@0: { sl@0: _LIT(LogClickCommandReply,"CommandReply(...)"); sl@0: aText.Append(LogClickCommandReply); sl@0: } sl@0: break; sl@0: case EWsClickOpSetKeyClick: sl@0: { sl@0: _LIT(LogSetKeyClick,"SetKeyClick(%u)"); sl@0: aText.AppendFormat(LogSetKeyClick, *pData.Bool); sl@0: } sl@0: break; sl@0: case EWsClickOpSetPenClick: sl@0: { sl@0: _LIT(LogSetPenClick,"SetPenClick(%u)"); sl@0: aText.AppendFormat(LogSetPenClick, *pData.Bool); sl@0: } sl@0: break; sl@0: case EWsClickOpKeyClickEnabled: sl@0: { sl@0: _LIT(LogKeyClickEnabled,"KeyClickEnabled()"); sl@0: aText.Append(LogKeyClickEnabled); sl@0: } sl@0: break; sl@0: case EWsClickOpPenClickEnabled: sl@0: { sl@0: _LIT(LogPenClickEnabled,"PenClickEnabled()"); sl@0: aText.Append(LogPenClickEnabled); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownOpcode(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: TDesC &TWsDecoder::replyBufDetails(TInt aClass, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText) sl@0: { sl@0: iCommandDetailsText.Format(_L("Reply Buffer: ")); sl@0: switch (aClass) sl@0: { sl@0: case WS_HANDLE_GROUP_WINDOW: sl@0: ReplyBufWindowGroup(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText); sl@0: break; sl@0: case WS_HANDLE_CLIENT: sl@0: ReplyBufClient(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText); sl@0: break; sl@0: case WS_HANDLE_WINDOW: sl@0: ReplyBufWindow(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText); sl@0: break; sl@0: case WS_HANDLE_SCREEN_DEVICE: sl@0: ReplyBufScreenDevice(iCommandDetailsText, aOpcode, aReplyDes8, aReplyDesText); sl@0: break; sl@0: default: sl@0: iCommandDetailsText.Format(_L("Reply buffer not handled (%u)"), aClass); sl@0: UnKnown(); sl@0: break; sl@0: } sl@0: return iCommandDetailsText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::commandDetails(TInt aClass, TInt aOpcode, const TAny *aCmdData, TInt aHandle) sl@0: { sl@0: switch (aClass) sl@0: { sl@0: case WS_HANDLE_ROOT_WINDOW: sl@0: iCommandDetailsText.Format(_L("invalid class")); sl@0: break; sl@0: case WS_HANDLE_GROUP_WINDOW: sl@0: DecodeWindowGroup(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_CLIENT: sl@0: DecodeClient(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_WINDOW: sl@0: DecodeWindow(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_GC: sl@0: DecodeGc(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_SCREEN_DEVICE: sl@0: DecodeScreenDevice(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_ANIM_DLL: sl@0: DecodeAnimDll(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_SPRITE: sl@0: case WS_HANDLE_POINTER_CURSOR: sl@0: case WS_HANDLE_TEXT_CURSOR: sl@0: DecodeSpriteBase(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_BITMAP: sl@0: DecodeBitmap(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_DIRECT: sl@0: DecodeDirect(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: case WS_HANDLE_CLICK: sl@0: DecodeClick(iCommandDetailsText, aOpcode, aCmdData, aHandle); sl@0: break; sl@0: default: sl@0: iCommandDetailsText.Format(_L("unknown class (%u)"), aClass); sl@0: UnKnown(); sl@0: break; sl@0: } sl@0: iRequestFuncClass=aClass; sl@0: iPrevOpcode=aOpcode; sl@0: return iCommandDetailsText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::eventDetails(const TWsEvent *aWsEvent) sl@0: { sl@0: switch (aWsEvent->Type()) sl@0: { sl@0: case EEventKey: sl@0: iEventDetailsText.Format(_L("EEventKey (code %u, scanCode %u, mdfs 0x%04x, repeats %u)"), sl@0: aWsEvent->Key()->iCode, sl@0: aWsEvent->Key()->iScanCode, sl@0: aWsEvent->Key()->iModifiers, sl@0: aWsEvent->Key()->iRepeats); sl@0: break; sl@0: case EEventKeyUp: sl@0: iEventDetailsText.Format(_L("EEventKeyUp (scanCode %u, mdfs 0x%04x)"), sl@0: aWsEvent->Key()->iScanCode, sl@0: aWsEvent->Key()->iModifiers); sl@0: break; sl@0: case EEventKeyDown: sl@0: iEventDetailsText.Format(_L("EEventKeyDown (scanCode %u, mdfs 0x%04x)"), sl@0: aWsEvent->Key()->iScanCode, sl@0: aWsEvent->Key()->iModifiers); sl@0: break; sl@0: case EEventPointer: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition)); sl@0: TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition)); sl@0: iEventDetailsText.Format(_L("EEventPointer (type %S, modifiers 0x%x, pos %S, global-pos %S)"), sl@0: &buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3); sl@0: } sl@0: break; sl@0: case EEventDragDrop: sl@0: { sl@0: TShortBuf buf1(TDebugLogTextHandler::PointerEventType(aWsEvent->Pointer()->iType)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iPosition)); sl@0: TShortBuf buf3(TDebugLogTextHandler::FormatPoint(aWsEvent->Pointer()->iParentPosition)); sl@0: iEventDetailsText.Format(_L("EEventDragDrop (type %S, modifiers 0x%x, pos %S, global-pos %S)"), sl@0: &buf1,aWsEvent->Pointer()->iModifiers,&buf2,&buf3); sl@0: } sl@0: break; sl@0: case EEventPointerEnter: sl@0: iEventDetailsText.Format(_L("EEventPointerEnter")); sl@0: break; sl@0: case EEventPointerExit: sl@0: iEventDetailsText.Format(_L("EEventPointerExit")); sl@0: break; sl@0: case EEventFocusLost: sl@0: iEventDetailsText.Format(_L("EEventFocusLost")); sl@0: break; sl@0: case EEventFocusGained: sl@0: iEventDetailsText.Format(_L("EEventFocusGained")); sl@0: break; sl@0: case EEventModifiersChanged: sl@0: iEventDetailsText.Format(_L("EEventModifiersChanged")); sl@0: break; sl@0: case EEventSwitchOn: sl@0: iEventDetailsText.Format(_L("EEventSwitchOn")); sl@0: break; sl@0: case EEventPassword: sl@0: iEventDetailsText.Format(_L("EEventPassword")); sl@0: break; sl@0: case EEventWindowGroupsChanged: sl@0: iEventDetailsText.Format(_L("EEventWindowGroupsChanged")); sl@0: break; sl@0: case EEventErrorMessage: sl@0: iEventDetailsText.Format(_L("EEventErrorMessage (%d,%d)"),aWsEvent->ErrorMessage()->iErrorCategory,aWsEvent->ErrorMessage()->iError); sl@0: break; sl@0: case EEventMessageReady: sl@0: iEventDetailsText.Format(_L("EEventMessageReady")); sl@0: break; sl@0: case EEventScreenDeviceChanged: sl@0: iEventDetailsText.Format(_L("EEventScreenDeviceChanged")); sl@0: break; sl@0: case EEventSwitchOff: sl@0: { sl@0: _LIT(LogEventSwitchOff,"EEventSwitchOff"); sl@0: iEventDetailsText.Format(LogEventSwitchOff); sl@0: } sl@0: break; sl@0: case EEventKeySwitchOff: sl@0: { sl@0: _LIT(LogEventKeySwitchOff,"EEventKeySwitchOff"); sl@0: iEventDetailsText.Format(LogEventKeySwitchOff); sl@0: } sl@0: break; sl@0: case EEventFocusGroupChanged: sl@0: { sl@0: _LIT(LogEventFocusGroupChanged,"EEventFocusGroupChanged"); sl@0: iEventDetailsText.Format(LogEventFocusGroupChanged); sl@0: } sl@0: break; sl@0: case EEventCaseOpened: sl@0: { sl@0: _LIT(LogEventCaseOpened,"EEventCaseOpened"); sl@0: iEventDetailsText.Format(LogEventCaseOpened); sl@0: } sl@0: break; sl@0: case EEventCaseClosed: sl@0: { sl@0: _LIT(LogEventCaseClosed,"EEventCaseClosed"); sl@0: iEventDetailsText.Format(LogEventCaseClosed); sl@0: } sl@0: break; sl@0: default: sl@0: if (aWsEvent->Type()>=EEventUser) sl@0: iEventDetailsText.Format(_L("EEventUser[%d]"), aWsEvent->Type()-EEventUser); sl@0: else sl@0: { sl@0: UnKnown(); sl@0: iEventDetailsText.Format(_L("Unknown event type=%d "), aWsEvent->Type()); sl@0: } sl@0: break; sl@0: } sl@0: return iEventDetailsText; sl@0: } sl@0: sl@0: TDesC &TWsDecoder::eventDetails(const TRawEvent *aEvent) sl@0: { sl@0: iEventDetailsText.Zero(); sl@0: switch (aEvent->Type()) sl@0: { sl@0: case TRawEvent::ENone: sl@0: { sl@0: _LIT(LogEventDetailsNone,"ENone"); sl@0: iEventDetailsText.Append(LogEventDetailsNone); sl@0: } sl@0: break; sl@0: case TRawEvent::EPointerMove: sl@0: { sl@0: _LIT(LogEventDetailsPointerMove,"EPointerMove("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsPointerMove); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EPointerSwitchOn: sl@0: { sl@0: _LIT(LogEventDetailsPointerSwitchOn,"EPointerSwitchOn("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsPointerSwitchOn); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EKeyDown: sl@0: { sl@0: _LIT(LogEventDetailsKeyDown,"EKeyDown(%d)"); sl@0: iEventDetailsText.Format(LogEventDetailsKeyDown,aEvent->ScanCode()); sl@0: } sl@0: break; sl@0: case TRawEvent::EKeyUp: sl@0: { sl@0: _LIT(LogEventDetailsKeyUp,"EKeyUp(%d)"); sl@0: iEventDetailsText.Format(LogEventDetailsKeyUp,aEvent->ScanCode()); sl@0: } sl@0: break; sl@0: case TRawEvent::ERedraw: sl@0: { sl@0: _LIT(LogEventDetailsRedraw,"ERedraw"); sl@0: iEventDetailsText.Append(LogEventDetailsRedraw); sl@0: } sl@0: break; sl@0: case TRawEvent::ESwitchOn: sl@0: { sl@0: _LIT(LogEventDetailsSwitchOn,"ESwitchOn"); sl@0: iEventDetailsText.Append(LogEventDetailsSwitchOn); sl@0: } sl@0: break; sl@0: case TRawEvent::EActive: sl@0: { sl@0: _LIT(LogEventDetailsActive,"EActive"); sl@0: iEventDetailsText.Append(LogEventDetailsActive); sl@0: } sl@0: break; sl@0: case TRawEvent::EInactive: sl@0: { sl@0: _LIT(LogEventDetailsInactive,"EInactive"); sl@0: iEventDetailsText.Append(LogEventDetailsInactive); sl@0: } sl@0: break; sl@0: case TRawEvent::EUpdateModifiers: sl@0: { sl@0: _LIT(LogEventDetailsModifiers,"EUpdateModifiers(%d)"); sl@0: iEventDetailsText.Format(LogEventDetailsModifiers,aEvent->Modifiers()); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton1Down: sl@0: { sl@0: _LIT(LogEventDetailsButton1Down,"EButton1Down("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton1Down); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton1Up: sl@0: { sl@0: _LIT(LogEventDetailsButton1Up,"EButton1Up("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton1Up); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton2Down: sl@0: { sl@0: _LIT(LogEventDetailsButton2Down,"EButton2Down("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton2Down); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton2Up: sl@0: { sl@0: _LIT(LogEventDetailsButton2Up,"EButton2Up("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton2Up); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton3Down: sl@0: { sl@0: _LIT(LogEventDetailsButton3Down,"EButton3Down("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton3Down); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::EButton3Up: sl@0: { sl@0: _LIT(LogEventDetailsButton3Up,"EButton3Up("); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatPoint(aEvent->Pos())); sl@0: iEventDetailsText.Append(LogEventDetailsButton3Up); sl@0: iEventDetailsText.Append(buf); sl@0: iEventDetailsText.Append(LogCloseBracket); sl@0: } sl@0: break; sl@0: case TRawEvent::ESwitchOff: sl@0: { sl@0: _LIT(LogEventDetailsSwitchOff,"ESwitchOff"); sl@0: iEventDetailsText.Append(LogEventDetailsSwitchOff); sl@0: } sl@0: break; sl@0: case TRawEvent::EKeyRepeat: sl@0: { sl@0: _LIT(LogEventDetailsKeyRepeat,"ERepeatKey(scancode=%d,repeat=%d"); sl@0: iEventDetailsText.Format(LogEventDetailsKeyRepeat,aEvent->ScanCode(),aEvent->Repeats()); sl@0: } sl@0: break; sl@0: case TRawEvent::EPointer3DOutOfRange: sl@0: { sl@0: _LIT(LogEventDetailsOutOfRange,"EPointer3DOutOfRange"); sl@0: iEventDetailsText.Format(LogEventDetailsOutOfRange); sl@0: } sl@0: break; sl@0: default: sl@0: { sl@0: _LIT(LogEventDetailsUnknown,"Unknown event type: %d"); sl@0: iEventDetailsText.Format(LogEventDetailsUnknown,aEvent->Type()); sl@0: UnKnown(); sl@0: } sl@0: break; sl@0: } sl@0: return iEventDetailsText; sl@0: } sl@0: sl@0: void TWsDecoder::ReplyBufWindowGroup(TBuf &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText) sl@0: { sl@0: ReplyBufWindow(aText, aOpcode, aReplyDes8, aReplyDesText); sl@0: } sl@0: sl@0: void TWsDecoder::ReplyBufWindow(TBuf &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText) sl@0: { sl@0: switch (aOpcode) sl@0: { sl@0: case EWsWinOpPosition: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsWinOpAbsPosition: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsWinOpSize: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsWinOpInquireOffset: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsWinOpName: sl@0: AppendDesc(aText, aReplyDesText); sl@0: break; sl@0: case EWsWinOpRetrievePointerMoveBuffer: sl@0: aText.Append(_L("...")); sl@0: break; sl@0: case EWsWinOpGetInvalidRegion: sl@0: { sl@0: TRect *rect=(TRect *)aReplyDes8->Ptr(); sl@0: TInt count=aReplyDes8->Size()/sizeof(TRect); sl@0: TBuf<2> comma; sl@0: _LIT(LogTwoStrings,"%S%S"); sl@0: for(TInt index=0;index &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *aReplyDesText) sl@0: { sl@0: switch (aOpcode) sl@0: { sl@0: case EWsClOpGetEvent: sl@0: { sl@0: const TWsEvent *wsEvent=(TWsEvent *)aReplyDes8->Ptr(); sl@0: TPtrC details(eventDetails(wsEvent)); sl@0: aText=KNullDesC; sl@0: if (details!=KNullDesC) sl@0: { sl@0: TDebugLogTextHandler::Append(aText, details); sl@0: TBuf<128> buf; sl@0: _LIT(LogReplyClientDestTime,"(dest %d, time "); sl@0: _LIT(LogReplyClientTime,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S%.%*C2%:3)"); sl@0: buf.Format(LogReplyClientDestTime, wsEvent->Handle()); sl@0: TDebugLogTextHandler::Append(aText, buf); sl@0: TRAPD(err,wsEvent->Time().FormatL(buf,LogReplyClientTime)); sl@0: if (err==KErrNone) sl@0: TDebugLogTextHandler::Append(aText, buf); sl@0: else sl@0: { sl@0: _LIT(LogReplyClientTimeErr,"######)"); sl@0: TDebugLogTextHandler::Append(aText,LogReplyClientTimeErr); sl@0: } sl@0: } sl@0: } sl@0: break; sl@0: case EWsClOpGetRedraw: sl@0: { sl@0: const TWsRedrawEvent *redrawEvent=(TWsRedrawEvent *)aReplyDes8->Ptr(); sl@0: TLongBuf buf(TDebugLogTextHandler::FormatRect(redrawEvent->Rect())); sl@0: aText.Format(_L("Redraw (handle %d): "), redrawEvent->Handle()); sl@0: aText.AppendFormat(_L("rect %S"), &buf); sl@0: } sl@0: break; sl@0: case EWsClOpGetPriorityKey: sl@0: { sl@0: const TWsPriorityKeyEvent *abortEvent=(TWsPriorityKeyEvent *)aReplyDes8->Ptr(); sl@0: aText.Format(_L("Abort key handle %d"), abortEvent->Handle()); sl@0: } sl@0: break; sl@0: case EWsClOpShadowVector: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsClOpGetWindowGroupClientThreadId: sl@0: { sl@0: const TThreadId *threadId=(TThreadId *)aReplyDes8->Ptr(); sl@0: aText.Format(_L("TThreadId=%d"), *(TInt *)threadId); sl@0: } sl@0: break; sl@0: case EWsClOpGetWindowGroupNameFromIdentifier: sl@0: AppendDesc(aText, aReplyDesText); sl@0: break; sl@0: case EWsClOpWindowGroupList: sl@0: case EWsClOpWindowGroupListAndChain: sl@0: case EWsClOpWindowGroupListAllPriorities: sl@0: { sl@0: TInt *handlPtr=(TInt *)aReplyDes8->Ptr(); sl@0: TInt count=aReplyDes8->Size()/sizeof(TInt); sl@0: TBuf<2> comma; sl@0: _LIT(LogStringInt,"%S%d"); sl@0: for(TInt index=0;indexPtr(); sl@0: aText.AppendFormat(_L("initial=%d,normal=%d"),settings->iInitialTime.Int(),settings->iTime.Int()); sl@0: } sl@0: break; sl@0: case EWsClOpGetDoubleClickSettings: sl@0: { sl@0: SDoubleClickSettings *settings=(SDoubleClickSettings *)aReplyDes8->Ptr(); sl@0: aText.AppendFormat(_L("interval=%d,distance=%d"),settings->iInterval.Int(),settings->iDistance); sl@0: } sl@0: break; sl@0: case EWsClOpFetchMessage: sl@0: { sl@0: _LIT(LogClientRetFetchMessage,"FetchMessage"); sl@0: aText.Append(LogClientRetFetchMessage); sl@0: } sl@0: break; sl@0: case EWsClOpCreateGraphic: sl@0: aText.AppendFormat(_L("Creating graphic: %s"), aReplyDes8); sl@0: break; sl@0: case EWsClOpGetGraphicMessage: sl@0: aText.AppendFormat(_L("Graphic message: %s"), aReplyDes8); sl@0: break; sl@0: case EWsClOpPointerCursorPosition: sl@0: { sl@0: TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr(); sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area)); sl@0: aText.AppendFormat(_L("Cursor position area=%S"), &buf1); sl@0: } sl@0: break; sl@0: case EWsClOpPointerCursorArea: sl@0: { sl@0: TWsClCmdSetPointerCursorArea *settings=(TWsClCmdSetPointerCursorArea*)aReplyDes8->Ptr(); sl@0: TLongBuf buf1(TDebugLogTextHandler::FormatRect(settings->area)); sl@0: aText.AppendFormat(_L("Cursor area=%S"), &buf1); sl@0: } sl@0: break; sl@0: case EWsClOpGetDefModeMaxNumColors: sl@0: { sl@0: SDefModeMaxNumColors *settings=(SDefModeMaxNumColors*)aReplyDes8->Ptr(); sl@0: aText.AppendFormat(_L("Num of colors=%d, num of grays=%d, display mode=%d"),settings->iColors, settings->iGrays, settings->iDisplayMode); sl@0: } sl@0: break; sl@0: default: sl@0: UnKnownReplyBuf(aText, aOpcode); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void TWsDecoder::ReplyBufScreenDevice(TBuf &aText, TInt aOpcode, const TDesC8 *aReplyDes8, const TDesC *) sl@0: { sl@0: switch (aOpcode) sl@0: { sl@0: case EWsSdOpGetScanLine: sl@0: { //This fills up the log two much for test code sl@0: aText=KNullDesC; sl@0: //Alternate code that would log this information. sl@0: /*_LIT(LogScreenDeviceReplyBufGetScanLine,"aScanLine set to ..."); sl@0: aText=LogScreenDeviceReplyBufGetScanLine;*/ sl@0: /*TDebugLogTextHandler::Append(aText, TDebugLogTextHandler::FormatArray(TDebugLogTextHandler::ERgb, sl@0: ((TDesC8 *)aReplyData)->Ptr(),((TDesC8 *)aReplyData)->Length()*sizeof(TRgb)));*/ sl@0: } sl@0: break; sl@0: case EWsSdOpHorizontalTwipsToPixels: sl@0: case EWsSdOpVerticalTwipsToPixels: sl@0: case EWsSdOpHorizontalPixelsToTwips: sl@0: case EWsSdOpVerticalPixelsToTwips: sl@0: case EWsSdOpPixelSize: sl@0: case EWsSdOpTwipsSize: sl@0: AppendPoint(aText,aReplyDes8); sl@0: break; sl@0: case EWsSdOpPointerRect: sl@0: AppendRect(aText,aReplyDes8); sl@0: break; sl@0: case EWsSdOpGetDefaultScreenSizeAndRotation: sl@0: case EWsSdOpGetScreenModeSizeAndRotation: sl@0: { sl@0: _LIT(LogScreenDeviceReplyBufPTR,"%S %S %d"); sl@0: const TPixelsTwipsAndRotation *sar=(TPixelsTwipsAndRotation *)aReplyDes8->Ptr(); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatSize(sar->iPixelSize)); sl@0: TShortBuf buf2(TDebugLogTextHandler::FormatSize(sar->iTwipsSize)); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufPTR,&buf1,&buf2,sar->iRotation); sl@0: } sl@0: break; sl@0: case EWsSdOpGetDefaultScreenSizeAndRotation2: sl@0: case EWsSdOpGetScreenModeSizeAndRotation2: sl@0: { sl@0: _LIT(LogScreenDeviceReplyBufPR,"%S %d"); sl@0: const TPixelsAndRotation *sar=(TPixelsAndRotation *)aReplyDes8->Ptr(); sl@0: TShortBuf buf(TDebugLogTextHandler::FormatSize(sar->iPixelSize)); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufPR,&buf,sar->iRotation); sl@0: } sl@0: break; sl@0: case EWsSdOpGetPalette: sl@0: { sl@0: _LIT(LogScreenDeviceReplyBufGetPalette,"Palette returned ..."); sl@0: aText.Append(LogScreenDeviceReplyBufGetPalette); sl@0: } sl@0: break; sl@0: case EWsSdOpGetDefaultScreenModeOrigin: sl@0: { sl@0: const TPoint *point = reinterpret_cast(aReplyDes8->Ptr()); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point)); sl@0: _LIT(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin,"Default screen mode origin=%S"); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufGetDefaultScreenModeOrigin, &buf1); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeOrigin: sl@0: { sl@0: const TPoint *point = reinterpret_cast(aReplyDes8->Ptr()); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point)); sl@0: _LIT(LogScreenDeviceReplyBufGetScreenModeOrigin,"Screen mode origin=%S"); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeOrigin, &buf1); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeScale: sl@0: case EWsSdOpGetCurrentScreenModeScale: sl@0: { sl@0: const TSize *size = reinterpret_cast(aReplyDes8->Ptr()); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatSize(*size)); sl@0: _LIT(LogScreenDeviceReplyBufGetScreenScale,"Screen scale=%S"); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufGetScreenScale, &buf1); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenModeScaledOrigin: sl@0: { sl@0: const TPoint *point = reinterpret_cast(aReplyDes8->Ptr()); sl@0: TShortBuf buf1(TDebugLogTextHandler::FormatPoint(*point)); sl@0: _LIT(LogScreenDeviceReplyBufGetScreenModeScaledOrigin,"Screen mode scaled origin=%S"); sl@0: aText.AppendFormat(LogScreenDeviceReplyBufGetScreenModeScaledOrigin, &buf1); sl@0: } sl@0: break; sl@0: case EWsSdOpGetCurrentScreenModeAttributes: sl@0: { sl@0: TSizeMode *settings=(TSizeMode*)aReplyDes8->Ptr(); sl@0: TShortBuf origin(TDebugLogTextHandler ::FormatPoint(settings->iOrigin)); sl@0: TShortBuf size(TDebugLogTextHandler ::FormatSize(settings->iScreenSize)); sl@0: TShortBuf area(TDebugLogTextHandler ::FormatRect(settings->iPointerCursorArea)); sl@0: aText.AppendFormat(_L("Screen attribute: origin=%S, size=%s, rotation=%d, area=$s, display mode = %d"), sl@0: &origin, &size, settings->iAlternativeRotations, &area, settings->iDefaultDisplayMode); sl@0: } sl@0: break; sl@0: case EWsSdOpGetScreenSizeModeList: sl@0: AppendDesc(aText, aReplyDes8); sl@0: break; sl@0: default: sl@0: UnKnownReplyBuf(aText, aOpcode); sl@0: break; sl@0: } sl@0: }