void CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci, UINT characterCount, UINT title, UINT description) { psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; psci->cChars = characterCount; psci->csFlags = ColumnFlags; MAKESTRING(title); lstrcpynW(psci->wszTitle, stringtablebuffer, MAX_COLUMN_NAME_LEN); MAKESTRING(description); lstrcpynW(psci->wszDescription, stringtablebuffer, MAX_COLUMN_DESC_LEN); }
/******************************************************************************************* Functions (Add any additional functions here) Note: Functions must be physically placed before the location in the code that calls them. *******************************************************************************************/ FUNCTION ESRL8_MAKE_485_STR(INTEGER _ID, INTEGER PARAM_2, INTEGER PARAM_3) { INTEGER CHECK_SUM, i; INTEGER BYTES[10]; STRING STR$[10]; BYTES[0] = 0xFF; BYTES[1] = 0x05; BYTES[2] = _ID; BYTES[3] = TIPO; BYTES[4] = PARAM_2; BYTES[5] = PARAM_3; BYTES[6] = 0x00; BYTES[7] = 0x00; // CHECK_SUM = BYTES[0]; // FOR (i = 1 TO 7) { // CHECK_SUM = CHECK_SUM ^ BYTES[i]; // } // BYTES[8] = CHECK_SUM; BYTES[8] = VIRTUAL_CHECKSUM; BYTES[9] = 0x0D; // Enviar comando STR$ = ""; FOR (i = 0 TO 9) { MAKESTRING(STR$, "%s%c", STR$, BYTES[i]); }
// IColumnProvider members STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) { PreserveChdir preserveChdir; if (dwIndex > 0) // TODO: keep for now to be able to hide unimplemented columns return S_FALSE; ShellCache::CacheType cachetype = g_ShellCache.GetCacheType(); if (cachetype == ShellCache::none) return S_FALSE; LoadLangDll(); switch (dwIndex) { case 0: // Git Status GetColumnInfo(dwIndex, psci, 15, IDS_COLTITLESTATUS, IDS_COLDESCSTATUS); break; case 1: // Git Revision GetColumnInfo(dwIndex, psci, 40, IDS_COLTITLEREV, IDS_COLDESCREV); break; case 2: // Git Url GetColumnInfo(dwIndex, psci, 30, IDS_COLTITLEURL, IDS_COLDESCURL); break; case 3: // Git Short Url GetColumnInfo(dwIndex, psci, 30, IDS_COLTITLESHORTURL, IDS_COLDESCSHORTURL); break; case 4: // Author and Git Author psci->scid.fmtid = FMTID_SummaryInformation; // predefined FMTID psci->scid.pid = PIDSI_AUTHOR; // Predefined - author psci->vt = VT_LPSTR; // We'll return the data as a string psci->fmt = LVCFMT_LEFT; // Text will be left-aligned in the column psci->csFlags = SHCOLSTATE_TYPE_STR; // Data should be sorted as strings psci->cChars = 32; // Default col width in chars MAKESTRING(IDS_COLTITLEAUTHOR); lstrcpynW(psci->wszTitle, stringtablebuffer, MAX_COLUMN_NAME_LEN); MAKESTRING(IDS_COLDESCAUTHOR); lstrcpynW(psci->wszDescription, stringtablebuffer, MAX_COLUMN_DESC_LEN); break; case 5: // SVN eol-style GetColumnInfo(dwIndex, psci, 30, IDS_COLTITLEEOLSTYLE, IDS_COLDESCEOLSTYLE); break; default: return S_FALSE; } return S_OK; }
void CArray::Dump(CDumpContext& dc) const { ASSERT_VALID(this); #define MAKESTRING(x) #x AFX_DUMP1(dc, "a " MAKESTRING(CArray) " with ", m_nSize); AFX_DUMP0(dc, " elements"); #undef MAKESTRING #if 0 if (dc.GetDepth() > 0) { AFX_DUMP0(dc, "\n"); for (int i = 0; i < m_nSize; i++) { AFX_DUMP1(dc, "\n\t[", i); AFX_DUMP1(dc, "] = ", m_pData[i]); } } #endif }
void CMapDWORDToChar::Dump(CDumpContext& dc) const { ASSERT_VALID(this); #define MAKESTRING(x) #x AFX_DUMP1(dc, "a " MAKESTRING(CMapDWORDToChar) " with ", m_nCount); AFX_DUMP0(dc, " elements"); #undef MAKESTRING if (dc.GetDepth() > 0) { // Dump in format "[key] -> value" POSITION pos = GetStartPosition(); DWORD key; char val; AFX_DUMP0(dc, "\n"); while (pos != NULL) { GetNextAssoc(pos, key, val); AFX_DUMP1(dc, "\n\t[", key); // AFX_DUMP1(dc, "] = ", val); } } }
/** Requests de-initialization of the OpenMAX IL core. It closes the session to the IL Core server. @return OMX_ERRORTYPE */ OMX_ERRORTYPE ROmxILCoreClientSession::DeinitAndClose() { DEBUG_PRINTF(_L8("ROmxILCoreClientSession::DeinitAndClose")); #ifdef SYMBIAN_PERF_TRACE_OMX_IL OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin, Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_DeInit)); #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1 OstTrace0( TRACE_API, _DeinitAndClose1, "OMX_Deinit >" ); #endif // Param 0 OMX_ERRORTYPE err = OMX_ErrorNone; TPckgBuf<OMX_ERRORTYPE> pckg0; // Param 1 TUint64 serverThreadId = 0; TPckgBuf<TUint64> pckg1; TIpcArgs arg(&pckg0, &pckg1); SendReceive(EOmxILCoreDeinit, arg); // Extract the output values returned from the server. err = pckg0(); serverThreadId = pckg1(); RHandleBase::Close(); // Release server handle so it will exit cleanly. XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache(); __ASSERT_ALWAYS(pGlobalILCoreCache != NULL, User::Panic(KOmxILCoreClientPanic, KErrNotReady)); pGlobalILCoreCache->SetServerHandle(KNullHandle); RThread serverThread; TInt ret = serverThread.Open(TThreadId(serverThreadId)); if ((KErrNone == ret) && (serverThread.Handle() != KNullHandle)) { DEBUG_PRINTF2(_L8("ROmxILCoreClientSession::DeinitAndClose : serverThread.Handle =[%d]"), serverThread.Handle()); TBool logoffFailed = EFalse; TRequestStatus logoffStatus; serverThread.Logon(logoffStatus); if (logoffStatus == KErrNoMemory) { logoffFailed = ETrue; } if (!logoffFailed) { if (logoffStatus == KRequestPending) { User::WaitForRequest(logoffStatus); } else { serverThread.LogonCancel(logoffStatus); User::WaitForRequest(logoffStatus); } } else { serverThread.Kill(KErrDied); } } serverThread.Close(); #if defined(SYMBIAN_PERF_TRACE_OMX_IL) || defined(SYMBIAN_PERF_TRACE_OMX_IL_OSTV1) OMX_ERRORTYPE omxError = OMX_ErrorNone; if(KErrNone != err) { omxError = OMX_ErrorUndefined; } #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL TBuf8<1> DeInitStr; OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat, Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_DeInit), omxError,&DeInitStr); #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1 OstTrace1( TRACE_API, _DeinitAndClose2, "OMX_Deinit < ReturnVal=%u", omxError ); #endif return err; }
/** Starts the separate IL Core server thread if not already started @return KErrAlreadyExists if the IL Core server has already been started. System-wide error if the creation of the session with the IL Core server did not succeed. */ TInt ROmxILCoreClientSession::Connect() { DEBUG_PRINTF(_L8("ROmxILCoreClientSession::Connect")); #ifdef SYMBIAN_PERF_TRACE_OMX_IL OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin, Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_Init)); #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1 OstTrace0( TRACE_API, _Connect1, "OMX_Init >" ); #endif TInt err = KErrNotFound; XGlobalILCoreCache *glbCache = XGlobalILCoreCache::IlCoreCache(); if(!glbCache) { err = KErrGeneral; } else { if(glbCache->ServerHandle().Handle() != KNullHandle) { err = CreateSession(glbCache->ServerHandle(), TVersion(1,0,0)); } if(err == KErrNotFound) { // Server not running TUint32 serverHandle = KNullHandle; if (KErrNone == (err = StartOmxILCoreServer(&serverHandle))) { if (KErrNone == (err = glbCache->SetServerHandle(serverHandle) )) { if(glbCache->ServerHandle().Handle() == KNullHandle) { err = KErrNotFound; } else { err = CreateSession(glbCache->ServerHandle(), TVersion(1,0,0)); } } } } else { // The server exists already... close the session and return... RHandleBase::Close(); err = KErrAlreadyExists; } } #if defined(SYMBIAN_PERF_TRACE_OMX_IL) || defined(SYMBIAN_PERF_TRACE_OMX_IL_OSTV1) OMX_ERRORTYPE omxError = OMX_ErrorNone; if(KErrNone != err) { omxError = OMX_ErrorUndefined; } #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL TBufC8<1> InitStr; OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat, Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_Init),omxError,&InitStr); #endif #ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1 OstTrace1( TRACE_API, _Connect2, "OMX_Init < ReturnVal=%u", omxError ); #endif return err; }