本文整理汇总了C++中NPNetscapeFuncs::retainobject方法的典型用法代码示例。如果您正苦于以下问题:C++ NPNetscapeFuncs::retainobject方法的具体用法?C++ NPNetscapeFuncs::retainobject怎么用?C++ NPNetscapeFuncs::retainobject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPNetscapeFuncs
的用法示例。
在下文中一共展示了NPNetscapeFuncs::retainobject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static bool
plugin_object_set_property (NPObject *npobj,
NPIdentifier name,
const NPVariant *value)
{
PluginObject *obj;
g_return_val_if_fail (plugin_object_has_property (npobj, name), FALSE);
obj = (PluginObject*) npobj;
if (obj->listener)
funcs.releaseobject (obj->listener);
obj->listener = NULL;
if (NPVARIANT_IS_OBJECT (*value))
{
obj->listener = NPVARIANT_TO_OBJECT (*value);
funcs.retainobject (obj->listener);
return TRUE;
}
else if (NPVARIANT_IS_NULL (*value))
return TRUE;
return FALSE;
}
示例2: sprintf
NPObject *NPN_RetainObject(NPObject* obj)
{
char msg[1024];
sprintf(msg, "NPN_RetainObject");
logger->logMessage(msg);
NPObject *rv = NPNFuncs.retainobject(obj);
sprintf(msg, "--Return: %x", rv);
logger->logMessage(msg);
return rv;
}
示例3:
static bool
plugin_object_set_callback (NPObject **listener,
const NPVariant *value)
{
if (!NPVARIANT_IS_OBJECT (*value) && !NPVARIANT_IS_NULL (*value))
return FALSE;
if (*listener)
funcs.releaseobject (*listener);
*listener = NULL;
if (NPVARIANT_IS_OBJECT (*value))
{
*listener = NPVARIANT_TO_OBJECT (*value);
funcs.retainobject (*listener);
}
return TRUE;
}
示例4: R_NP_GetGlobal
SEXP R_NP_GetGlobal(SEXP Rplug)
{
NPP inst = (NPP) R_ExternalPtrAddr(GET_SLOT( Rplug , Rf_install( "ref" ) ) );
NPNetscapeFuncs *funcs = (NPNetscapeFuncs *) R_ExternalPtrAddr(GET_SLOT( GET_SLOT(Rplug, Rf_install("funcs")), Rf_install("ref")));
NPObject *domwin = NULL;
NPVariant *toret = (NPVariant *) funcs->memalloc(sizeof(NPVariant));
//NPVariant vartmp2;
NPError res;
bool success;
res = funcs->getvalue(inst, NPNVWindowNPObject , &domwin);
funcs->retainobject(domwin);
OBJECT_TO_NPVARIANT(domwin, *toret);
SEXP ans;
PROTECT(ans = R_NilValue);
ConvertNPToR(toret, inst, funcs, CONV_REF, &ans);
UNPROTECT(1);
return ans;
}
示例5:
NPObject *NPN_RetainObject(NPObject *obj)
{
return NPNFuncs.retainobject(obj);
}