本文整理汇总了C++中NPNetscapeFuncs::setproperty方法的典型用法代码示例。如果您正苦于以下问题:C++ NPNetscapeFuncs::setproperty方法的具体用法?C++ NPNetscapeFuncs::setproperty怎么用?C++ NPNetscapeFuncs::setproperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPNetscapeFuncs
的用法示例。
在下文中一共展示了NPNetscapeFuncs::setproperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPN_SetProperty
bool NPN_SetProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant *variant)
{
char msg[1024];
sprintf(msg, "NPN_SetProperty");
logger->logMessage(msg);
bool rv = NPNFuncs.setproperty(id, obj, identifier, variant);
sprintf(msg, "--Return: %x", rv);
logger->logMessage(msg);
return rv;
}
示例2: R_NPAPI_SetProperty
SEXP R_NPAPI_SetProperty(SEXP plug, SEXP Robj, SEXP Rname, SEXP Rval, SEXP RconvValue)
{
NPP inst = (NPP) R_ExternalPtrAddr(GET_SLOT( plug , Rf_install( "ref" ) ) );
NPNetscapeFuncs *funcs = (NPNetscapeFuncs *) R_ExternalPtrAddr(GET_SLOT( GET_SLOT(plug, Rf_install("funcs")), Rf_install("ref")));
NPVariant *obj = (NPVariant *) R_ExternalPtrAddr(GET_SLOT( Robj , Rf_install( "ref" ) ) );
if(!NPVARIANT_IS_OBJECT(*obj))
{
//What should we return in this case?
Rf_error("Robj is not an NPVariant containing an NPObject.");
return R_NilValue;
}
convert_t convVal = (convert_t) INTEGER(RconvValue)[0];
//NPVariant *val = (NPVariant *) funcs->memalloc(sizeof(NPVariant));
NPVariant val;
ConvertRToNP(Rval, inst, funcs, &val, convVal);
const char *ccname = CHAR(STRING_ELT(Rname, 0));
bool success = funcs->setproperty(inst, obj->value.objectValue, funcs->getstringidentifier(ccname), &val);
if(!success)
{
//funcs->memfree(val);
Rf_error("SetProperty failed.");
return R_NilValue;
}
else {
funcs->releasevariantvalue(&val);
//funcs->memfree(val);
}
return ScalarLogical(success) ;
}
示例3: NPN_SetProperty
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
const NPVariant *value)
{
return NPNFuncs.setproperty(npp, obj, propertyName, value);
}