本文整理汇总了C++中CJS_Runtime::GetObjectPrivate方法的典型用法代码示例。如果您正苦于以下问题:C++ CJS_Runtime::GetObjectPrivate方法的具体用法?C++ CJS_Runtime::GetObjectPrivate怎么用?C++ CJS_Runtime::GetObjectPrivate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJS_Runtime
的用法示例。
在下文中一共展示了CJS_Runtime::GetObjectPrivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Target_Field
Field* CJS_EventHandler::Target_Field() {
CJS_Runtime* pRuntime = m_pJSEventContext->GetJSRuntime();
v8::Local<v8::Object> pDocObj =
pRuntime->NewFxDynamicObj(CJS_Document::g_nObjDefnID);
if (pDocObj.IsEmpty())
return nullptr;
v8::Local<v8::Object> pFieldObj =
pRuntime->NewFxDynamicObj(CJS_Field::g_nObjDefnID);
if (pFieldObj.IsEmpty())
return nullptr;
CJS_Document* pJSDocument =
static_cast<CJS_Document*>(pRuntime->GetObjectPrivate(pDocObj));
CJS_Field* pJSField =
static_cast<CJS_Field*>(pRuntime->GetObjectPrivate(pFieldObj));
Document* pDocument = static_cast<Document*>(pJSDocument->GetEmbedObject());
pDocument->SetFormFillEnv(m_pTargetFormFillEnv
? m_pTargetFormFillEnv.Get()
: m_pJSEventContext->GetFormFillEnv());
Field* pField = static_cast<Field*>(pJSField->GetEmbedObject());
pField->AttachField(pDocument, m_strTargetName);
return pField;
}
示例2: activeDocs
bool app::activeDocs(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (!vp.IsGetting())
return false;
CJS_Context* pContext = (CJS_Context*)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Document* pJSDocument = nullptr;
v8::Local<v8::Object> pObj = pRuntime->GetThisObj();
if (CFXJS_Engine::GetObjDefnID(pObj) == CJS_Document::g_nObjDefnID) {
pJSDocument = static_cast<CJS_Document*>(pRuntime->GetObjectPrivate(pObj));
}
CJS_Array aDocs;
aDocs.SetElement(pRuntime, 0, CJS_Value(pRuntime, pJSDocument));
if (aDocs.GetLength(pRuntime) > 0)
vp << aDocs;
else
vp.GetJSValue()->SetNull(pRuntime);
return true;
}