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


C++ NPNetscapeFuncs::getvalue方法代码示例

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


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

示例1:

static void
cloud_spy_log (const gchar * log_domain, GLogLevelFlags log_level, const gchar * message, gpointer user_data)
{
  NPNetscapeFuncs * browser = cloud_spy_nsfuncs;
  NPP instance = static_cast<NPP> (user_data);
  NPObject * window = NULL, * console = NULL;
  NPVariant variant, result;
  NPError error;

  (void) log_domain;
  (void) log_level;

  error = browser->getvalue (instance, NPNVWindowNPObject, &window);
  if (error != NPERR_NO_ERROR)
    goto beach;

  VOID_TO_NPVARIANT (variant);
  if (!browser->getproperty (instance, window, browser->getstringidentifier ("console"), &variant))
    goto beach;
  console = NPVARIANT_TO_OBJECT (variant);

  STRINGZ_TO_NPVARIANT (message, variant);
  VOID_TO_NPVARIANT (result);
  if (!browser->invoke (instance, console, browser->getstringidentifier ("log"), &variant, 1, &result))
    goto beach;
  browser->releasevariantvalue (&result);

beach:
  if (console != NULL)
    browser->releaseobject (console);
  if (window != NULL)
    browser->releaseobject (window);
}
开发者ID:key2,项目名称:frida-ire,代码行数:33,代码来源:cloud-spy-plugin.cpp

示例2: strlen

NPError
NPP_New(NPMIMEType pluginType, NPP npp, uint16_t mode, int16_t argc, char *argn[],
        char *argv[], NPSavedData *saved)
{
    trace_info_f("%s\n", __func__);

    NPObject *np_plugin_element_obj;

    int err = npn.getvalue(npp, NPNVPluginElementNPObject, &np_plugin_element_obj);
    if (err != NPERR_NO_ERROR) {
        trace_warning("%s, NPN_GetValue returned %d\n", __func__, err);
        goto done;
    }

    NPVariant result;
    NPString script = {
        .UTF8Characters = resource_text_libpdf_frontend_js,
        .UTF8Length = strlen(resource_text_libpdf_frontend_js),
    };

    if (!npn.evaluate(npp, np_plugin_element_obj, &script, &result)) {
        trace_warning("%s, NPN_Evaluate failed\n", __func__);
    }

done:
    return NPERR_NO_ERROR;
}
开发者ID:WizardGed,项目名称:freshplayerplugin,代码行数:27,代码来源:np_libpdf_frontend.c

示例3:

NPError
NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
    NPError rv = NPERR_GENERIC_ERROR;
    if (NPNFuncs.getvalue) {
        rv = NPNFuncs.getvalue(instance, variable, value);
    }
    return rv;
}
开发者ID:ascendancy721,项目名称:gnash,代码行数:9,代码来源:npn_gate.cpp

示例4: MyNPN_GetValue

static
NPError MyNPN_GetValue(NPP instance, NPNVariable variable,
               void *value)
{
	NPError ret;
	DEB(ef, "-> NPN_GetValue( %x, %d, 0x%x)\n", instance, variable, value);		
	ret = gNetscapeFuncs.getvalue( instance, variable, value );
	DEB(ef, "<- NPN_GetValue = %d\n", ret);
	return ret;
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:10,代码来源:wrapper.c

示例5: NPN_GetValue

NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
    NPError rv = NPERR_NO_ERROR;

    if(logger)
        logger->logCall(action_npn_get_value, (DWORD)instance, (DWORD)variable, (DWORD)value);

    rv = NPNFuncs.getvalue(instance, variable, value);

    if(logger)
        logger->logReturn(action_npn_get_value);

    return rv;
}
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:14,代码来源:npn_gate.cpp

示例6: 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;
}
开发者ID:gmbecker,项目名称:RBrowserPlugin,代码行数:21,代码来源:NPAPI.cpp

示例7: NPN_GetValue

NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
  return NPNFuncs.getvalue(instance, variable, value);
}
开发者ID:gfunkmonk2,项目名称:mate-movie-player,代码行数:4,代码来源:idolNPNGlue.cpp

示例8:

NPError
NPP_New(NPMIMEType    mimetype,
	NPP           instance,
	uint16_t      mode,
	int16_t       argc,
	char        **argn,
	char        **argv,
	NPSavedData  *saved)
{
  /* instance initialization function */
  NPError ret = NPERR_NO_ERROR;
  PluginData *data;
  GError *error = NULL;

  /* first, check if the location is what we expect */
  NPObject *window;
  NPVariant document;
  NPVariant location;
  NPVariant href;

  g_debug ("plugin created");

  funcs.getvalue (instance, NPNVWindowNPObject, &window);

  funcs.getproperty (instance, window,
		     funcs.getstringidentifier ("document"),
		     &document);
  g_assert (NPVARIANT_IS_OBJECT (document));

  funcs.getproperty (instance, NPVARIANT_TO_OBJECT (document),
		     funcs.getstringidentifier ("location"),
		     &location);
  g_assert (NPVARIANT_IS_OBJECT (location));

  funcs.getproperty (instance, NPVARIANT_TO_OBJECT (location),
		     funcs.getstringidentifier ("href"),
		     &href);
  g_assert (NPVARIANT_IS_STRING (href));

  if (strncmp (NPVARIANT_TO_STRING (href).UTF8Characters, ORIGIN, sizeof (ORIGIN)-1))
    {
      g_debug ("origin does not match, is %s", NPVARIANT_TO_STRING (href).UTF8Characters);

      if (!ALLOW_FOREIGN_ORIGIN)
	{
	  ret = NPERR_GENERIC_ERROR;
	  goto out;
	}
    }

  data = g_slice_new (PluginData);
  instance->pdata = data;

  data->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
					       G_DBUS_PROXY_FLAGS_NONE,
					       NULL, /* interface info */
					       "org.gnome.Shell",
					       "/org/gnome/Shell",
					       "org.gnome.Shell",
					       NULL, /* GCancellable */
					       &error);
  if (!data->proxy) {
    /* ignore error if the shell is not running, otherwise warn */
    if (error->domain != G_DBUS_ERROR ||
	error->code != G_DBUS_ERROR_NAME_HAS_NO_OWNER)
      {
	g_warning ("Failed to set up Shell proxy: %s", error->message);
	g_error_clear (&error);
      }
    ret = NPERR_GENERIC_ERROR;
  }

  g_debug ("plugin created successfully");

 out:
  funcs.releaseobject (window);
  funcs.releasevariantvalue (&document);
  funcs.releasevariantvalue (&location);
  funcs.releasevariantvalue (&href);

  return ret;
}
开发者ID:gcampax,项目名称:sweettooth-plugin,代码行数:82,代码来源:sweettooth-plugin.c

示例9:

static gboolean
check_origin_and_protocol (NPP instance)
{
  gboolean ret = FALSE;
  NPError error;
  NPObject *window = NULL;
  NPVariant document = { NPVariantType_Void };
  NPVariant location = { NPVariantType_Void };
  gchar *hostname = NULL;
  gchar *protocol = NULL;

  error = funcs.getvalue (instance, NPNVWindowNPObject, &window);
  if (error != NPERR_NO_ERROR)
    goto out;

  if (!funcs.getproperty (instance, window,
                          funcs.getstringidentifier ("document"),
                          &document))
    goto out;

  if (!NPVARIANT_IS_OBJECT (document))
    goto out;

  if (!funcs.getproperty (instance, NPVARIANT_TO_OBJECT (document),
                          funcs.getstringidentifier ("location"),
                          &location))
    goto out;

  if (!NPVARIANT_IS_OBJECT (location))
    goto out;

  hostname = get_string_property (instance,
                                  NPVARIANT_TO_OBJECT (location),
                                  "hostname");

  if (g_strcmp0 (hostname, ORIGIN))
    {
      g_debug ("origin does not match, is %s",
               hostname);

      goto out;
    }

  protocol = get_string_property (instance,
                                  NPVARIANT_TO_OBJECT (location),
                                  "protocol");

  if (g_strcmp0 (protocol, "https:") != 0)
    {
      g_debug ("protocol does not match, is %s",
               protocol);

      goto out;
    }

  ret = TRUE;

 out:
  g_free (protocol);
  g_free (hostname);

  funcs.releasevariantvalue (&location);
  funcs.releasevariantvalue (&document);

  if (window != NULL)
    funcs.releaseobject (window);
  return ret;
}
开发者ID:PeterDaveHello,项目名称:deepin-gnome-shell,代码行数:68,代码来源:browser-plugin.c


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