当前位置: 首页>>代码示例>>C++>>正文


C++ FX_BSTRC函数代码示例

本文整理汇总了C++中FX_BSTRC函数的典型用法代码示例。如果您正苦于以下问题:C++ FX_BSTRC函数的具体用法?C++ FX_BSTRC怎么用?C++ FX_BSTRC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FX_BSTRC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: v_Load

FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
    CPDF_Dictionary* pDict = pArray->GetDict(1);
    if (!pDict)
        return FALSE;

    CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
    int i;
    for (i = 0; i < 3; i ++) {
        m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
    }
    pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
    for (i = 0; i < 3; i ++) {
        m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
    }
    pParam = pDict->GetArray(FX_BSTRC("Gamma"));
    if (pParam) {
        m_bGamma = TRUE;
        for (i = 0; i < 3; i ++) {
            m_Gamma[i] = pParam->GetNumber(i);
        }
    } else {
        m_bGamma = FALSE;
    }
    pParam = pDict->GetArray(FX_BSTRC("Matrix"));
    if (pParam) {
        m_bMatrix = TRUE;
        for (i = 0; i < 9; i ++) {
            m_Matrix[i] = pParam->GetNumber(i);
        }
    } else {
        m_bMatrix = FALSE;
    }
    return TRUE;
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:35,代码来源:fpdf_page_colors.cpp

示例2: FPDFDOC_OCG_GetUsageTypeString

FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
{
    if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) {
        return TRUE;
    }
    CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType);
    CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage"));
    if (pUsage) {
        CPDF_Dictionary *pState = pUsage->GetDict(csState);
        if (pState) {
            CFX_ByteString csFind = csState + FX_BSTRC("State");
            if (pState->KeyExist(csFind)) {
                return pState->GetString(csFind) != FX_BSTRC("OFF");
            }
        }
        if (csState != FX_BSTRC("View")) {
            pState = pUsage->GetDict(FX_BSTRC("View"));
            if (pState && pState->KeyExist(FX_BSTRC("ViewState"))) {
                return pState->GetString(FX_BSTRC("ViewState")) != FX_BSTRC("OFF");
            }
        }
    }
    FX_BOOL bDefValid = FALSE;
    return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid);
}
开发者ID:151706061,项目名称:PDFium,代码行数:25,代码来源:doc_ocg.cpp

示例3: CPDF_Pattern

CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
{
    m_PatternType = PATTERN_SHADING;
    m_pPatternObj = bShading ? NULL : pPatternObj;
    m_pDocument = pDoc;
    m_bShadingObj = bShading;
    if (!bShading) {
        CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
        ASSERT(pDict != NULL);
        m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
        m_pShadingObj = pDict->GetElementValue(FX_BSTRC("Shading"));
        if (parentMatrix) {
            m_Pattern2Form.Concat(*parentMatrix);
        }
    } else {
        m_pShadingObj = pPatternObj;
    }
    m_ShadingType = 0;
    m_pCS = NULL;
    m_nFuncs = 0;
    for (int i = 0; i < 4; i ++) {
        m_pFunctions[i] = NULL;
    }
    m_pCountedCS = NULL;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:25,代码来源:fpdf_page_pattern.cpp

示例4: if

FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
{
    if (m_pObj == NULL) {
        return FALSE;
    }
    if (m_pObj->GetType() == PDFOBJ_DICTIONARY) {
        CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj;
        csFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
        if (csFileName.IsEmpty()) {
            csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
        }
        if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
            return TRUE;
        }
        if (csFileName.IsEmpty()) {
            if (pDict->KeyExist(FX_BSTRC("DOS"))) {
                csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
            } else if (pDict->KeyExist(FX_BSTRC("Mac"))) {
                csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Mac")));
            } else if (pDict->KeyExist(FX_BSTRC("Unix"))) {
                csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix")));
            } else {
                return FALSE;
            }
        }
    } else {
        csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
    }
    csFileName = FILESPEC_DecodeFileName(csFileName);
    return TRUE;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:31,代码来源:doc_basic.cpp

示例5: FX_Free

void CPDF_Stream::SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf)
{
    if (m_GenNum == (FX_DWORD) - 1) {
        if (m_pDataBuf) {
            FX_Free(m_pDataBuf);
        }
    } else {
        m_GenNum = (FX_DWORD) - 1;
        m_pCryptoHandler = NULL;
    }
    if (bKeepBuf) {
        m_pDataBuf = (FX_LPBYTE)pData;
    } else {
        m_pDataBuf = FX_Alloc(FX_BYTE, size);
        if (pData) {
            FXSYS_memcpy32(m_pDataBuf, pData, size);
        }
    }
    m_dwSize = size;
    if (m_pDict == NULL) {
        m_pDict = new CPDF_Dictionary;
    }
    m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
    if (!bCompressed) {
        m_pDict->RemoveAt(FX_BSTRC("Filter"));
        m_pDict->RemoveAt(FX_BSTRC("DecodeParms"));
    }
}
开发者ID:duanhjlt,项目名称:pdfium,代码行数:28,代码来源:fpdf_parser_objects.cpp

示例6: while

FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
{
    while (1) {
        CFX_ByteStringC word = parser.GetWord();
        if (word.IsEmpty()) {
            return FALSE;
        }
        if (word == FX_BSTRC("}")) {
            return TRUE;
        }
        if (word == FX_BSTRC("{")) {
            CPDF_PSProc* pProc = FX_NEW CPDF_PSProc;
            m_Operators.Add((FX_LPVOID)PSOP_PROC);
            m_Operators.Add(pProc);
            if (!pProc->Parse(parser)) {
                return FALSE;
            }
        } else {
            int i = 0;
            while (_PDF_PSOpNames[i].name) {
                if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
                    m_Operators.Add((FX_LPVOID)_PDF_PSOpNames[i].op);
                    break;
                }
                i ++;
            }
            if (_PDF_PSOpNames[i].name == NULL) {
                FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
                *pd = FX_atof(word);
                m_Operators.Add((FX_LPVOID)PSOP_CONST);
                m_Operators.Add(pd);
            }
        }
    }
}
开发者ID:witwall,项目名称:pdfium,代码行数:35,代码来源:fpdf_page_func.cpp

示例7: FX_OpenFolder

void CFPF_SkiaFontMgr::ScanPath(FX_BSTR path)
{
    void *handle = FX_OpenFolder(path.GetCStr());
    if (!handle) {
        return;
    }
    CFX_ByteString filename;
    FX_BOOL	bFolder = FALSE;
    while (FX_GetNextFile(handle, filename, bFolder)) {
        if (bFolder) {
            if (filename == FX_BSTRC(".") || filename == FX_BSTRC("..")) {
                continue;
            }
        } else {
            CFX_ByteString ext = filename.Right(4);
            ext.MakeLower();
            if (ext != FX_BSTRC(".ttf") && ext != FX_BSTRC(".ttc")) {
                continue;
            }
        }
        CFX_ByteString fullpath = path;
        fullpath += "/";
        fullpath += filename;
        if (bFolder) {
            ScanPath(fullpath);
        } else {
            ScanFile(fullpath);
        }
    }
    FX_CloseFolder(handle);
}
开发者ID:BlissRoms,项目名称:platform_external_pdfium,代码行数:31,代码来源:fpf_skiafontmgr.cpp

示例8:

CPDF_NameTree::CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category)
{
    if (pDoc->GetRoot() && pDoc->GetRoot()->GetDict(FX_BSTRC("Names")))
        m_pRoot = pDoc->GetRoot()->GetDict(FX_BSTRC("Names"))->GetDict(category);
    else
        m_pRoot = NULL;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:7,代码来源:doc_basic.cpp

示例9: if

CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj)
{
    if (pFuncObj == NULL) {
        return NULL;
    }
    CPDF_Function* pFunc = NULL;
    int type;
    if (pFuncObj->GetType() == PDFOBJ_STREAM) {
        type = ((CPDF_Stream*)pFuncObj)->GetDict()->GetInteger(FX_BSTRC("FunctionType"));
    } else if (pFuncObj->GetType() == PDFOBJ_DICTIONARY) {
        type = ((CPDF_Dictionary*)pFuncObj)->GetInteger(FX_BSTRC("FunctionType"));
    } else {
        return NULL;
    }
    if (type == 0) {
        pFunc = FX_NEW CPDF_SampledFunc;
    } else if (type == 2) {
        pFunc = FX_NEW CPDF_ExpIntFunc;
    } else if (type == 3) {
        pFunc = FX_NEW CPDF_StitchFunc;
    } else if (type == 4) {
        pFunc = FX_NEW CPDF_PSFunc;
    } else {
        return NULL;
    }
    if (!pFunc->Init(pFuncObj)) {
        delete pFunc;
        return NULL;
    }
    return pFunc;
}
开发者ID:witwall,项目名称:pdfium,代码行数:31,代码来源:fpdf_page_func.cpp

示例10: InsertNewPage

static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageDict, CFX_DWordArray &pageList)
{
    CPDF_Dictionary* pRoot = pDoc->GetRoot();
    if (!pRoot) {
        return -1;
    }
    CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
    if (!pPages) {
        return -1;
    }
    int nPages = pDoc->GetPageCount();
    if (iPage < 0 || iPage > nPages) {
        return -1;
    }
    if (iPage == nPages) {
        CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
        if (!pPagesList) {
            pPagesList = FX_NEW CPDF_Array;
            pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
        }
        pPagesList->Add(pPageDict, pDoc);
        pPages->SetAtInteger(FX_BSTRC("Count"), nPages + 1);
        pPageDict->SetAtReference(FX_BSTRC("Parent"), pDoc, pPages->GetObjNum());
    } else {
        CFX_PtrArray stack;
        stack.Add(pPages);
        if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
            return -1;
        }
    }
    pageList.InsertAt(iPage, pPageDict->GetObjNum());
    return iPage;
}
开发者ID:ouyang789987,项目名称:PDFium.js,代码行数:33,代码来源:fpdf_edit_doc.cpp

示例11: FXSYS_assert

void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc)
{
    FXSYS_assert(pDoc != NULL);
    ((PDFDOC_LPMETADATA)m_pData)->m_pDoc = pDoc;
    CPDF_Dictionary *pRoot = pDoc->GetRoot();
    CPDF_Stream *pStream = pRoot->GetStream(FX_BSTRC("Metadata"));
    if (!pStream) {
        return;
    }
    CPDF_StreamAcc acc;
    acc.LoadAllData(pStream, FALSE);
    int size = acc.GetSize();
    FX_LPCBYTE pBuf = acc.GetData();
    CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
    pXmlElmnt = CXML_Element::Parse(pBuf, size);
    if (!pXmlElmnt) {
        return;
    }
    CXML_Element *&pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
    if (pXmlElmnt->GetTagName() == FX_BSTRC("RDF")) {
        pElmntRdf = pXmlElmnt;
    } else {
        pElmntRdf = pXmlElmnt->GetElement(NULL, FX_BSTRC("RDF"));
    }
}
开发者ID:codemonkey85,项目名称:pdfium,代码行数:25,代码来源:doc_metadata.cpp

示例12: FX_BSTRC

CPDF_FileSpec::CPDF_FileSpec()
{
    m_pObj = CPDF_Dictionary::Create();
    if (m_pObj != NULL) {
        ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Filespec"));
    }
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:7,代码来源:doc_basic.cpp

示例13: FX_Alloc

FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
{
    CPDF_Dictionary* pDict = pObj->GetDict();
    if (pDict == NULL) {
        return FALSE;
    }
    CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
    if (m_nOutputs == 0) {
        m_nOutputs = 1;
        if (pArray0) {
            m_nOutputs = pArray0->GetCount();
        }
    }
    CPDF_Array* pArray1 = pDict->GetArray(FX_BSTRC("C1"));
    m_pBeginValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
    m_pEndValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
    for (int i = 0; i < m_nOutputs; i ++) {
        m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
        m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
    }
    m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
    m_nOrigOutputs = m_nOutputs;
    if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
        return FALSE;
    }
    m_nOutputs *= m_nInputs;
    return TRUE;
}
开发者ID:witwall,项目名称:pdfium,代码行数:28,代码来源:fpdf_page_func.cpp

示例14: FXGETFLAG_COLORTYPE

void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
{
    if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
        pIccTransform = NULL;
    }
    FX_BOOL bCMYK = FALSE;
    if (pIccTransform) {
        ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
        color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
        FX_LPBYTE pColor = (FX_LPBYTE)&color;
        pIccModule->TranslateScanline(pIccTransform, pColor, pColor, 1);
        color = m_bCmykOutput ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
        bCMYK = m_bCmykOutput;
    } else {
        bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
    }
    if (bCMYK != m_bCmykOutput || !m_bColorSet || m_LastColor != color) {
        CFX_ByteTextBuf buf;
        if (bCMYK) {
            buf << FXSYS_GetCValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetMValue(color) / 255.0 << FX_BSTRC(" ")
                << FXSYS_GetYValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetKValue(color) / 255.0 << FX_BSTRC(" k\n");
        } else {
            buf << FXARGB_R(color) / 255.0 << FX_BSTRC(" ") << FXARGB_G(color) / 255.0 << FX_BSTRC(" ")
                << FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
        }
        if (bCMYK == m_bCmykOutput) {
            m_bColorSet = TRUE;
            m_LastColor = color;
        }
        m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
    }
}
开发者ID:Gardenya,项目名称:pdfium,代码行数:32,代码来源:fx_ge_ps.cpp

示例15: LoadDict

FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict,
                                               FX_DWORD type,
                                               int& cipher,
                                               int& key_len) {
  m_pEncryptDict = pEncryptDict;
  m_bOwner = FALSE;
  m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
  m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
  m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
  CFX_ByteString strf_name, stmf_name;
  if (m_Version >= 4) {
    stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
    strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
    if (stmf_name != strf_name) {
      return FALSE;
    }
  }
  if (!_LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) {
    return FALSE;
  }
  m_Cipher = cipher;
  m_KeyLen = key_len;
  return TRUE;
  return TRUE;
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:25,代码来源:fpdf_parser_encrypt.cpp


注:本文中的FX_BSTRC函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。