本文整理汇总了C++中CFXJSE_Value类的典型用法代码示例。如果您正苦于以下问题:C++ CFXJSE_Value类的具体用法?C++ CFXJSE_Value怎么用?C++ CFXJSE_Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFXJSE_Value类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FXJSE_V8_GenericNamedPropertyGetterCallback
static void FXJSE_V8_GenericNamedPropertyGetterCallback(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> thisObject = info.This();
const FXJSE_CLASS* lpClass =
static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
v8::String::Utf8Value szPropName(property);
CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
CFXJSE_Value* lpNewValue = CFXJSE_Value::Create(info.GetIsolate());
FXJSE_DynPropGetterAdapter(
lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName,
reinterpret_cast<FXJSE_HVALUE>(lpNewValue));
info.GetReturnValue().Set(lpNewValue->DirectGetValue());
delete lpThisValue;
lpThisValue = nullptr;
}
示例2: FXJSE_V8ProxyCallback_getOwnPropertyDescriptor_setter
static void FXJSE_V8ProxyCallback_getOwnPropertyDescriptor_setter(
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> hCallBackInfo = info.Data().As<v8::Object>();
FXJSE_CLASS* lpClass = static_cast<FXJSE_CLASS*>(
hCallBackInfo->GetAlignedPointerFromInternalField(0));
v8::Local<v8::String> hPropName =
hCallBackInfo->GetInternalField(1).As<v8::String>();
ASSERT(lpClass && !hPropName.IsEmpty());
v8::String::Utf8Value szPropName(hPropName);
CFX_ByteStringC szFxPropName = *szPropName;
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
CFXJSE_Value* lpNewValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(info.This());
lpNewValue->ForceSetValue(info[0]);
FXJSE_DynPropSetterAdapter(
lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName,
reinterpret_cast<FXJSE_HVALUE>(lpNewValue));
delete lpThisValue;
lpThisValue = nullptr;
delete lpNewValue;
lpNewValue = nullptr;
}
示例3: RunScript
FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
FX_BOOL bRet = FALSE;
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView) {
return bRet;
}
CXFA_WidgetAcc* pWidgetAcc =
static_cast<CXFA_WidgetAcc*>(pFormItem->GetWidgetData());
if (!pWidgetAcc) {
return bRet;
}
CXFA_EventParam EventParam;
EventParam.m_eType = XFA_EVENT_Unknown;
CFXJSE_Value* pRetValue = nullptr;
int32_t iRet =
pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue);
if (iRet == XFA_EVENTERROR_Success && pRetValue) {
bRet = pRetValue->ToBoolean();
delete pRetValue;
}
return bRet;
}
示例4: FXJSE_V8_GenericNamedPropertyQueryCallback
static void FXJSE_V8_GenericNamedPropertyQueryCallback(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
v8::Local<v8::Object> thisObject = info.This();
const FXJSE_CLASS* lpClass =
static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
v8::Isolate* pIsolate = info.GetIsolate();
v8::HandleScope scope(pIsolate);
v8::String::Utf8Value szPropName(property);
CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
if (FXJSE_DynPropQueryAdapter(lpClass,
reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
szFxPropName)) {
info.GetReturnValue().Set(v8::DontDelete);
} else {
const int32_t iV8Absent = 64;
info.GetReturnValue().Set(iV8Absent);
}
delete lpThisValue;
lpThisValue = nullptr;
}
示例5: FXJSE_V8ProxyCallback_delete
static void FXJSE_V8ProxyCallback_delete(
const v8::FunctionCallbackInfo<v8::Value>& info) {
info.GetReturnValue().Set(true);
const FXJSE_CLASS* lpClass =
static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
if (!lpClass) {
return;
}
v8::Isolate* pIsolate = info.GetIsolate();
v8::HandleScope scope(pIsolate);
v8::Local<v8::String> hPropName = info[0]->ToString();
v8::String::Utf8Value szPropName(hPropName);
CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(info.This());
info.GetReturnValue().Set(
FXJSE_DynPropDeleterAdapter(
lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName)
? true
: false);
delete lpThisValue;
lpThisValue = nullptr;
}
示例6: ThrowException
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(
CFXJSE_Arguments* pArguments,
FX_BOOL bAbsPage) {
int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
const FX_WCHAR* methodName;
if (bAbsPage) {
methodName = L"absPage";
} else {
methodName = L"page";
}
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName);
return;
}
CXFA_Node* pNode = nullptr;
if (iLength >= 1) {
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
int32_t iPage = 0;
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (!pNode && pValue)
pValue->SetInteger(iPage);
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
}
CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
if (!pLayoutItem) {
pValue->SetInteger(-1);
return;
}
iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
if (pValue)
pValue->SetInteger(bAbsPage ? iPage : iPage + 1);
}
示例7: FXJSE_Value_SetFloat
void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetFloat(fFloat);
}
示例8: FXJSE_Value_SetUTF8String
void FXJSE_Value_SetUTF8String(FXJSE_HVALUE hValue,
const CFX_ByteStringC& szString) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetString(szString);
}
示例9: FXJSE_Value_SetBoolean
void FXJSE_Value_SetBoolean(FXJSE_HVALUE hValue, FX_BOOL bBoolean) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetBoolean(bBoolean);
}
示例10: FXJSE_Value_SetNull
void FXJSE_Value_SetNull(FXJSE_HVALUE hValue) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetNull();
}
示例11: FXJSE_Value_ToObject
void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Class* lpClass = reinterpret_cast<CFXJSE_Class*>(hClass);
ASSERT(lpValue);
return lpValue->ToObject(lpClass);
}
示例12: FXJSE_Value_GetRuntime
FXJSE_HRUNTIME FXJSE_Value_GetRuntime(FXJSE_HVALUE hValue) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return reinterpret_cast<FXJSE_HRUNTIME>(lpValue->GetIsolate());
}
示例13: FXJSE_Value_SetInteger
void FXJSE_Value_SetInteger(FXJSE_HVALUE hValue, int32_t nInteger) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetInteger(nInteger);
}
示例14: FXJSE_Value_SetDate
void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
return lpValue->SetDate(dDouble);
}
示例15: FXJSE_Value_ToFloat
FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->ToFloat();
}