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;
}
예제 #2
0
bool NPN_Evaluate(NPP id, NPObject* obj, NPString* str, NPVariant* variant)
{
    char msg[1024];
    sprintf(msg, "NPN_Evaluate");
    logger->logMessage(msg);

    bool rv = NPNFuncs.evaluate(id, obj, str, variant);

    sprintf(msg, "--Return: %x", rv);
    logger->logMessage(msg);

    return rv;
}
예제 #3
0
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
                  NPVariant *result)
{
  return NPNFuncs.evaluate(npp, obj, script, result);
}