CFX_WideString	FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
{
    CFX_WideString wsFileName;
    if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
        CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFileSpec;
        wsFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
        if (wsFileName.IsEmpty()) {
            wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
        }
        if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
            return wsFileName;
        }
        if (wsFileName.IsEmpty() && pDict->KeyExist(FX_BSTRC("DOS"))) {
            wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
        }
    } else {
        wsFileName = CFX_WideString::FromLocal(pFileSpec->GetString());
    }
    if (wsFileName[0] != '/') {
        return ChangeSlash(wsFileName);
    }
    if (wsFileName[2] == '/') {
        CFX_WideString result;
        result += wsFileName[1];
        result += ':';
        result += ChangeSlash(((FX_LPCWSTR)wsFileName) + 2);
        return result;
    } else {
        CFX_WideString result;
        result += '\\';
        result += ChangeSlash(wsFileName);
        return result;
    }
}
示例#2
0
void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& filepath)
{
    CFX_WideString result;
    if (filepath.GetLength() > 1 && filepath[1] == ':') {
        result = L"/";
        result += filepath[0];
        if (filepath[2] != '\\') {
            result += '/';
        }
        result += ChangeSlash(filepath.c_str() + 2);
    } else if (filepath.GetLength() > 1 && filepath[0] == '\\' && filepath[1] == '\\') {
        result = ChangeSlash(filepath.c_str() + 1);
    } else {
        result = ChangeSlash(filepath);
    }
    if (pFileSpec->GetType() == PDFOBJ_STRING) {
        pFileSpec->SetString(CFX_ByteString::FromUnicode(result));
    } else if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
        ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(result));
        ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(result));
        ((CPDF_Dictionary*)pFileSpec)->RemoveAt(FX_BSTRC("FS"));
    }
}
示例#3
0
Result AppList::recvFromServer(Json::Value jsonObj)
{
    if (jsonObj.isMember("method")) {
        std::string str_method = jsonObj["method"].asString();

        if (str_method == "BasicCommunication.OnAppRegistered") {
            newAppRegistered(jsonObj);
            m_pUIManager->onAppShow(ID_APPLINK);
        }else if (str_method == "BasicCommunication.OnAppUnregistered") {
            int appID = jsonObj["params"]["appID"].asInt();
            m_pUIManager->onAppUnregister(appID);
        }else if (str_method == "VR.VRExitApp") {
            m_pUIManager->tsSpeak(ID_EXIT, "退出"+ m_pCurApp->m_szAppName);
            m_pUIManager->onAppShow(ID_APPLINK);
        }else if (str_method == "Navigation.StopStream") {            
            m_pUIManager->onVideoStreamStop();
            ShowPreviousUI();
        }else if (str_method == "VR.VRSwitchApp") {
//            {
//               "jsonrpc" : "2.0",
//               "method" : "VR.VRSwitchApp",
//               "params" : {
//                  "appID" : 18467,
//                  "appVRName" : "百度 "
//               }
//            }
            std::string strAppVRName = jsonObj["params"]["appVRName"].asString();
            if (!IsTextUTF8((char *)strAppVRName.data(),strAppVRName.size()))
                strAppVRName = string_To_UTF8(strAppVRName);

            m_pUIManager->tsSpeak(ID_SWITCHAPP, strAppVRName);

            int iNewID = jsonObj["params"]["appID"].asInt();
            if (m_pCurApp->m_iAppID != iNewID) {
                std::vector <AppData *>::iterator i;
                for (i = m_AppDatas.begin(); i != m_AppDatas.end(); ++i) {
                    if (iNewID == (*i)->m_iAppID) {
                        m_pCurApp = *i;
                        m_pUIManager->onAppShow(m_pCurApp->getCurUI());
                        break;
                    }
                }
            }
        }else if (str_method == "UI.SetAppIcon") {
            int iAppId = jsonObj["params"]["appID"].asInt();
            std::vector <AppData *>::iterator Iter = m_AppDatas.begin();
            while (Iter != m_AppDatas.end()) {
                if (iAppId == (*Iter)->m_iAppID) {
                    QUrl iconPathUrl(jsonObj["params"]["syncFileName"]["value"].asString().c_str());
#if defined(WINCE)
                    (*Iter)->m_strAppIconFilePath = ChangeSlash(iconPathUrl.path().toLocal8Bit().data());
#else
                    (*Iter)->m_strAppIconFilePath = ChangeSlash(iconPathUrl.path().toStdString());
#endif
                    if (m_pCurApp == NULL) {
                        m_pUIManager->onAppShow(ID_APPLINK);
                    }
                    //m_pUIManager->onAppShow(m_pCurApp->getCurUI());
                    break;
                }
                ++Iter;
            }
        }else if (str_method == "UI.EndAudioPassThru") {
            ToSDL->OnVRCancelRecord();
            m_pUIManager->OnEndAudioPassThru();
            return RESULT_SUCCESS;
        }else if (str_method == "BasicCommunication.UpdateDeviceList") {
            // add by fanqiang
            updateDeiveList(jsonObj);
            m_pUIManager->ShowDeviceList();
        }
        else {
            if (m_pCurApp)
                return m_pCurApp->recvFromServer(jsonObj);
            else
                return RESULT_APPLICATION_NOT_REGISTERED;
        }
        return  RESULT_SUCCESS;
    }
    return  RESULT_SUCCESS;
}
int main ( int argc, char* argv[] )
{
	char		szProjectFilePath	[_MAX_PATH	+1];
	char		szSourceFilePath	[_MAX_PATH	+1];
	char		szDrive						[_MAX_DRIVE	+1];
	char		szDir							[_MAX_DIR		+1];
	char		szExt							[_MAX_EXT		+1];
	char		szFname						[_MAX_PATH	+1];
	char		szOldDirectory		[_MAX_PATH	+1];
	int			i;
	_OPTIONS	*pOptTarget		= sOptions,
						*pOptPlatform	= sOptions,
						*pOptOS				= sOptions,
						*pOptFile			= sOptions,
						*pOptOpt			= sOptions;

	szProjectFilePath	[0] = '\0';
	szSourceFilePath	[0] = '\0';

	BOOL		flagPrint = TRUE;
	if ( argc < 2 )
		return 0;

	for ( i=2; i< argc; i++ )
		{
		 if ( i < argc )
			 *(argv[i]-1) = ' ';
		}
	ParseOptions( argv[1], sOptions, sOptionsSubst );
	GetCurrentDirectory( MAX_PATH, szOldDirectory );
	_splitpath( argv[1], szDrive, szDir, szFname, szExt );
	_makepath( szProjectFilePath, szDrive, szDir, szFname, szExt );
	ChangeSlash( szProjectFilePath );

	if( szProjectFilePath && ! access( szProjectFilePath, 4 ) )	// if a specified file exists
	{																														// and we have read access right

		if( strlen( szDir ) )
		{
			char		szProjectDirectory[_MAX_PATH	+1];
		
			szProjectDirectory[0] = '\0';
			strcat( szProjectDirectory, szDrive );
			strcat( szProjectDirectory, szDir );
			SetCurrentDirectory( szProjectDirectory );
		}

	FILE*	file;
	if ( flagPrint )
		{
		file= fopen(LOG_FILE_NAME, "w+t");
		fprintf(file, "%s", "MakePDF\n" );
		fclose(file);
		}

	while ( stricmp(pOptTarget	->pszOptionText, "TARGET"	 ) ) pOptTarget		++;
	while ( stricmp(pOptPlatform->pszOptionText, "PLATFORM") ) pOptPlatform	++;
	while ( stricmp(pOptOS			->pszOptionText, "OS"			 ) ) pOptOS				++;
	while ( stricmp(pOptFile		->pszOptionText, "FILE"		 ) ) pOptFile			++;
	while ( stricmp(pOptOpt			->pszOptionText, "OPTIONS" ) ) pOptOpt			++;

	if ( pOptFile->bOptionOn && *(pOptFile->pszOptionVal) )
		InternalConvertFileName( pOptFile->pszOptionVal, szSourceFilePath );

	SetCommonVar( pOptOS->pszOptionVal, pOptPlatform->pszOptionVal, pOptTarget->pszOptionVal ); 

	TargetNode		Head( szProjectFilePath, NULL );
	TargetNode*		pProjectNode;
	TargetNode*		pTarget;

	Head.ProcessNMake(TARGET_PROJECT);
	pProjectNode = Head.GetFirstChildPRJ();
	while ( pProjectNode )
		{
		 pProjectNode->ProcessNMake(TARGET_FILE_C);
		 if ( *szSourceFilePath && ( pTarget=pProjectNode->FindByNameTargetC(szSourceFilePath) ) != NULL )
				{
				 OptionNode	*pOption = pTarget->GetCompileOptions();
				 if ( pOption )
					{
					 printf(" cl -n %s", szSourceFilePath);
					 while ( pOption )
							{
							 printf(" -%s", pOption->GetOptionText() );
							 pOption= pOption->GetNext();
							}
					 printf("\n" );
					}
				 break;
				}
		 pProjectNode = pProjectNode->GetNext();
		}


	if ( !pOptFile->bOptionOn )
		{
			Head.CreateProjectTree();
			Head.RaiseUpPathC();
			Head.PrintProjectTree(0);
			Head.SetProjectPath();
			Head.ProcessFileH();
			Head.RaiseUpPathH();
			Head.RaiseUpTargetH();
			if (pOptOpt->bOptionOn)
				{
					Head.RaiseUpOptions();
					Head.WritePDFOptions();
				}
			Head.Wildcards();
			Head.PullDownPath();
			Head.PrintProjectTree(0);
			Head.ConvertFileName();
			Head.WritePDF();
		}
	SetCurrentDirectory( szOldDirectory );
	}
	
	return 0;
}