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


C++ CFX_PtrArray类代码示例

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


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

示例1: JS_NewFxDynamicObj

v8::Handle<v8::Object> JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, int nObjDefnID)
{
	v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
	v8::Isolate::Scope isolate_scope(isolate);
	if(-1 == nObjDefnID)
	{
		v8::Local<v8::ObjectTemplate> objTempl = v8::ObjectTemplate::New(isolate);
		return objTempl->NewInstance();
	}

	CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
	if(!pArray) return v8::Handle<v8::Object>();


	if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return v8::Handle<v8::Object>();
	CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);

	v8::Local<v8::Context> context = isolate->GetCurrentContext();
	v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
	v8::Local<v8::Object> obj = objTemp->NewInstance();

	CJS_PrivateData* pPrivateData = new CJS_PrivateData;
	pPrivateData->ObjDefID = nObjDefnID;

	obj->SetAlignedPointerInInternalField(0, pPrivateData);
	if(pObjDef->m_pConstructor)
		pObjDef->m_pConstructor(pJSContext, obj, context->Global()->GetPrototype()->ToObject());

	return obj;
}
开发者ID:mcanthony,项目名称:libpdf,代码行数:30,代码来源:fxjs_v8.cpp

示例2: while

int32_t CBC_OnedCode128Writer::Encode128C(const CFX_ByteString& contents,
                                          CFX_PtrArray& patterns) {
  int32_t checkSum = 0;
  int32_t checkWeight = 1;
  int32_t position = 0;
  patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]);
  checkSum += CODE_START_C * checkWeight;
  while (position < contents.GetLength()) {
    int32_t patternIndex = 0;
    FX_CHAR ch = contents.GetAt(position);
    if (ch < '0' || ch > '9') {
      patternIndex = (int32_t)ch;
      position++;
    } else {
      patternIndex = FXSYS_atoi(contents.Mid(position, 2));
      if (contents.GetAt(position + 1) < '0' ||
          contents.GetAt(position + 1) > '9') {
        position += 1;
      } else {
        position += 2;
      }
    }
    patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
    checkSum += patternIndex * checkWeight;
    if (position != 0) {
      checkWeight++;
    }
  }
  return checkSum;
}
开发者ID:andoma,项目名称:pdfium,代码行数:30,代码来源:BC_OnedCode128Writer.cpp

示例3: 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

示例4: adjustRowNumbersFromLRI

int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() {
  if (m_detectionResultColumns[0] == NULL) {
    return 0;
  }
  int32_t unadjustedCount = 0;
  CFX_PtrArray* codewords =
      ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0))
          ->getCodewords();
  for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
       codewordsRow++) {
    if (codewords->GetAt(codewordsRow) == NULL) {
      continue;
    }
    int32_t rowIndicatorRowNumber =
        ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
    int32_t invalidRowCounts = 0;
    for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 &&
                                    invalidRowCounts < ADJUST_ROW_NUMBER_SKIP;
         barcodeColumn++) {
      CBC_Codeword* codeword =
          (CBC_Codeword*)((CBC_DetectionResultColumn*)
                              m_detectionResultColumns[barcodeColumn])
              ->getCodewords()
              ->GetAt(codewordsRow);
      if (codeword) {
        invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber,
                                                  invalidRowCounts, codeword);
        if (!codeword->hasValidRowNumber()) {
          unadjustedCount++;
        }
      }
    }
  }
  return unadjustedCount;
}
开发者ID:JinAirsOs,项目名称:pdfium,代码行数:35,代码来源:BC_PDF417DetectionResult.cpp

示例5: BC_EXCEPTION_CHECK_ReturnValue

CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap* image,
                                        FX_BOOL multiple,
                                        int32_t hints,
                                        int32_t& e) {
  CFX_ByteString results;
  CBC_PDF417DetectorResult* detectorResult =
      CBC_Detector::detect(image, hints, multiple, e);
  BC_EXCEPTION_CHECK_ReturnValue(e, "");
  for (int32_t i = 0; i < detectorResult->getPoints()->GetSize(); i++) {
    CFX_PtrArray* points = (CFX_PtrArray*)detectorResult->getPoints()->GetAt(i);
    CBC_CommonDecoderResult* ResultTemp = CBC_PDF417ScanningDecoder::decode(
        detectorResult->getBits(), (CBC_ResultPoint*)points->GetAt(4),
        (CBC_ResultPoint*)points->GetAt(5), (CBC_ResultPoint*)points->GetAt(6),
        (CBC_ResultPoint*)points->GetAt(7), getMinCodewordWidth(*points),
        getMaxCodewordWidth(*points), e);
    if (ResultTemp == NULL) {
      delete detectorResult;
      e = BCExceptiontNotFoundInstance;
      return "";
    }
    results += ResultTemp->GetText();
    delete ResultTemp;
  }
  delete detectorResult;
  return results;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:26,代码来源:BC_PDF417Reader.cpp

示例6: JS_ReleaseRuntime

void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Persistent<v8::Context>& v8PersistentContext)
{
	v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
	v8::Isolate::Scope isolate_scope(isolate);
	v8::HandleScope handle_scope(isolate);
	v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate, v8PersistentContext);
	v8::Context::Scope context_scope(context);

	CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
	if(!pArray) return ;

	for(int i=0; i<pArray->GetSize(); i++)
	{
		CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
		if(!pObjDef->m_StaticObj.IsEmpty())
		{
			v8::Local<v8::Object> pObj = v8::Local<v8::Object>::New(isolate, pObjDef->m_StaticObj);
			if(pObjDef->m_pDestructor)
				pObjDef->m_pDestructor(pObj);
			JS_FreePrivate(pObj);
		}
		delete pObjDef;
	}
	delete pArray;
	isolate->SetData(0,NULL);
}
开发者ID:mcanthony,项目名称:libpdf,代码行数:26,代码来源:fxjs_v8.cpp

示例7: ASSERT

FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
	ASSERT(m_pDocument != NULL);

	if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
		m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
		m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;

	CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
	ASSERT(pInterForm != NULL);

	CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
	ASSERT(pPDFForm != NULL);

	v8::Isolate* isolate = GetIsolate(cc);
	CJS_Array aName(isolate);

	if (params.size() > 0)
	{
		switch (params[0].GetType())
		{
		default:
			aName.Attach(params[0].ToV8Array());
			break;
		case VT_string:
			aName.SetElement(0,params[0]);
			break;
		}

		CFX_PtrArray aFields;

		for (int i=0,isz=aName.GetLength(); i<isz; i++)
		{
			CJS_Value valElement(isolate);
			aName.GetElement(i,valElement);
			CFX_WideString swVal = valElement.ToCFXWideString();

			for (int j=0,jsz=pPDFForm->CountFields(swVal); j<jsz; j++)
			{
				aFields.Add((void*)pPDFForm->GetField(j,swVal));
			}
		}

		if (aFields.GetSize() > 0)
		{
			pPDFForm->ResetForm(aFields, TRUE, TRUE);
			m_pDocument->SetChangeMark();

		}
	}
	else
	{
		pPDFForm->ResetForm(TRUE);
		m_pDocument->SetChangeMark();

	}

	return TRUE;
}
开发者ID:mcanthony,项目名称:libpdf,代码行数:59,代码来源:Document.cpp

示例8: GetPageLinks

int CPDF_LinkList::CountLinks(CPDF_Page* pPage)
{
    CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
    if (pPageLinkList == NULL) {
        return 0;
    }
    return pPageLinkList->GetSize();
}
开发者ID:MWisBest,项目名称:android_external_pdfium,代码行数:8,代码来源:doc_link.cpp

示例9:

int	CPDF_LayoutElement::CountObjects()
{
    if(m_pTaggedElement == NULL) {
        return 0;
    }
    CFX_PtrArray* pObj = &m_ObjArray;
    int size = pObj->GetSize();
    return size;
}
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:9,代码来源:layoutprovider_taggedpdf.cpp

示例10: findRowsWithPattern

CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix,
                                         int32_t startRow,
                                         int32_t startColumn) {
  int32_t height = matrix->GetHeight();
  int32_t width = matrix->GetWidth();
  CFX_PtrArray* result = new CFX_PtrArray;
  result->SetSize(8);
  CFX_PtrArray* startptr = findRowsWithPattern(
      matrix, height, width, startRow, startColumn, START_PATTERN,
      sizeof(START_PATTERN) / sizeof(START_PATTERN[0]));
  copyToResult(
      result, startptr, INDEXES_START_PATTERN,
      sizeof(INDEXES_START_PATTERN) / sizeof(INDEXES_START_PATTERN[0]));
  startptr->RemoveAll();
  delete startptr;
  if (result->GetAt(4) != NULL) {
    startColumn = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetX();
    startRow = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetY();
  }
  CFX_PtrArray* stopptr = findRowsWithPattern(
      matrix, height, width, startRow, startColumn, STOP_PATTERN,
      sizeof(STOP_PATTERN) / sizeof(STOP_PATTERN[0]));
  copyToResult(result, stopptr, INDEXES_STOP_PATTERN,
               sizeof(INDEXES_STOP_PATTERN) / sizeof(INDEXES_STOP_PATTERN[0]));
  stopptr->RemoveAll();
  delete stopptr;
  return result;
}
开发者ID:andoma,项目名称:pdfium,代码行数:28,代码来源:BC_PDF417Detector.cpp

示例11: NextStates

void CFWL_CheckBoxImp::NextStates() {
  FX_DWORD dwFirststate = m_pProperties->m_dwStates;
  if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) {
    if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) ==
        FWL_STATE_CKB_Unchecked) {
      CFWL_WidgetMgr* pWidgetMgr =
          static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
      if (!pWidgetMgr->IsFormDisabled()) {
        CFX_PtrArray radioarr;
        pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr);
        IFWL_CheckBox* pCheckBox = NULL;
        int32_t iCount = radioarr.GetSize();
        for (int32_t i = 0; i < iCount; i++) {
          pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]);
          if (pCheckBox != m_pInterface &&
              pCheckBox->GetStates() & FWL_STATE_CKB_Checked) {
            pCheckBox->SetCheckState(0);
            CFX_RectF rt;
            pCheckBox->GetWidgetRect(rt);
            rt.left = rt.top = 0;
            m_pWidgetMgr->RepaintWidget(pCheckBox, &rt);
            break;
          }
        }
      }
      m_pProperties->m_dwStates |= FWL_STATE_CKB_Checked;
    }
  } else {
    if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) ==
        FWL_STATE_CKB_Neutral) {
      m_pProperties->m_dwStates &= ~FWL_STATE_CKB_CheckMask;
      if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_3State) {
        m_pProperties->m_dwStates |= FWL_STATE_CKB_Checked;
      }
    } else if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) ==
               FWL_STATE_CKB_Checked) {
      m_pProperties->m_dwStates &= ~FWL_STATE_CKB_CheckMask;
    } else {
      if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_3State) {
        m_pProperties->m_dwStates |= FWL_STATE_CKB_Neutral;
      } else {
        m_pProperties->m_dwStates |= FWL_STATE_CKB_Checked;
      }
    }
  }
  Repaint(&m_rtClient);
  FX_DWORD dwLaststate = m_pProperties->m_dwStates;
  if (dwFirststate != dwLaststate) {
    CFWL_EvtCkbCheckStateChanged wmCheckBoxState;
    wmCheckBoxState.m_pSrcTarget = m_pInterface;
    DispatchEvent(&wmCheckBoxState);
  }
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:53,代码来源:fwl_checkboximp.cpp

示例12: delete

CBC_PDF417DetectorResult::~CBC_PDF417DetectorResult() {
  for (int32_t i = 0; i < m_points->GetSize(); i++) {
    CFX_PtrArray* temp = (CFX_PtrArray*)m_points->GetAt(i);
    for (int32_t j = 0; j < temp->GetSize(); j++) {
      delete (CBC_ResultPoint*)temp->GetAt(j);
    }
    temp->RemoveAll();
    delete temp;
  }
  m_points->RemoveAll();
  delete m_points;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:12,代码来源:BC_PDF417DetectorResult.cpp

示例13: GetObject

CPDF_PageObject* CPDF_LayoutElement::GetObject(int index)
{
    if(m_pTaggedElement == NULL) {
        return NULL;
    }
    CFX_PtrArray *pObj = &m_ObjArray;
    int size = pObj->GetSize();
    if(index < size) {
        return (CPDF_PageObject*)pObj->GetAt(index);
    }
    return NULL;
}
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:12,代码来源:layoutprovider_taggedpdf.cpp

示例14: getCodewords

CBC_BarcodeMetadata*
CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() {
  CFX_PtrArray* codewords = getCodewords();
  CBC_BarcodeValue barcodeColumnCount;
  CBC_BarcodeValue barcodeRowCountUpperPart;
  CBC_BarcodeValue barcodeRowCountLowerPart;
  CBC_BarcodeValue barcodeECLevel;
  for (int32_t i = 0; i < codewords->GetSize(); i++) {
    CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i);
    if (codeword == NULL) {
      continue;
    }
    codeword->setRowNumberAsRowIndicatorColumn();
    int32_t rowIndicatorValue = codeword->getValue() % 30;
    int32_t codewordRowNumber = codeword->getRowNumber();
    if (!m_isLeft) {
      codewordRowNumber += 2;
    }
    switch (codewordRowNumber % 3) {
      case 0:
        barcodeRowCountUpperPart.setValue(rowIndicatorValue * 3 + 1);
        break;
      case 1:
        barcodeECLevel.setValue(rowIndicatorValue / 3);
        barcodeRowCountLowerPart.setValue(rowIndicatorValue % 3);
        break;
      case 2:
        barcodeColumnCount.setValue(rowIndicatorValue + 1);
        break;
    }
  }
  if ((barcodeColumnCount.getValue()->GetSize() == 0) ||
      (barcodeRowCountUpperPart.getValue()->GetSize() == 0) ||
      (barcodeRowCountLowerPart.getValue()->GetSize() == 0) ||
      (barcodeECLevel.getValue()->GetSize() == 0) ||
      barcodeColumnCount.getValue()->GetAt(0) < 1 ||
      barcodeRowCountUpperPart.getValue()->GetAt(0) +
              barcodeRowCountLowerPart.getValue()->GetAt(0) <
          CBC_PDF417Common::MIN_ROWS_IN_BARCODE ||
      barcodeRowCountUpperPart.getValue()->GetAt(0) +
              barcodeRowCountLowerPart.getValue()->GetAt(0) >
          CBC_PDF417Common::MAX_ROWS_IN_BARCODE) {
    return NULL;
  }
  CBC_BarcodeMetadata* barcodeMetadata =
      new CBC_BarcodeMetadata(barcodeColumnCount.getValue()->GetAt(0),
                              barcodeRowCountUpperPart.getValue()->GetAt(0),
                              barcodeRowCountLowerPart.getValue()->GetAt(0),
                              barcodeECLevel.getValue()->GetAt(0));
  removeIncorrectCodewords(codewords, *barcodeMetadata);
  return barcodeMetadata;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:52,代码来源:BC_PDF417DetectionResultRowIndicatorColumn.cpp

示例15: JS_GetStaticObj

v8::Handle<v8::Object> JS_GetStaticObj(IJS_Runtime* pJSRuntime, int nObjDefnID)
{
	v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
	v8::Isolate::Scope isolate_scope(isolate);

	CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
	if(!pArray) return v8::Handle<v8::Object>();

	if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return v8::Handle<v8::Object>();
	CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
	v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(isolate,pObjDef->m_StaticObj);
	return obj;
}
开发者ID:mcanthony,项目名称:libpdf,代码行数:13,代码来源:fxjs_v8.cpp


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