实现一个android webkit插件,在哪里可以找到官方文档?

时间:2012-05-29 07:29:32

标签: android plugins browser webkit

我正在尝试实现一个webkit插件。我知道webkit插件采用NPAPI,所以我从mozilla网站上查找,发现它很有帮助(对于moziila,它是Gecko插件,但也采用NPAPI)。 好吧,还有一些问题, 例如,当我编写NPP_Destroy方法时,我需要调用NPNetscapeFuncs的releaseobject。我从android源代码检查了NPNetscapeFuncs定义,releaseobject定义如下:

typedef struct _NPNetscapeFuncs {
uint16_t size;
uint16_t version;

NPN_GetURLProcPtr geturl;
NPN_PostURLProcPtr posturl;
NPN_RequestReadProcPtr requestread;
NPN_NewStreamProcPtr newstream;
NPN_WriteProcPtr write;
NPN_DestroyStreamProcPtr destroystream;
NPN_StatusProcPtr status;
NPN_UserAgentProcPtr uagent;
NPN_MemAllocProcPtr memalloc;
NPN_MemFreeProcPtr memfree;
NPN_MemFlushProcPtr memflush;
NPN_ReloadPluginsProcPtr reloadplugins;
NPN_GetJavaEnvProcPtr getJavaEnv;
NPN_GetJavaPeerProcPtr getJavaPeer;
NPN_GetURLNotifyProcPtr geturlnotify;
NPN_PostURLNotifyProcPtr posturlnotify;
NPN_GetValueProcPtr getvalue;
NPN_SetValueProcPtr setvalue;
NPN_InvalidateRectProcPtr invalidaterect;
NPN_InvalidateRegionProcPtr invalidateregion;
NPN_ForceRedrawProcPtr forceredraw;

NPN_GetStringIdentifierProcPtr getstringidentifier;
NPN_GetStringIdentifiersProcPtr getstringidentifiers;
NPN_GetIntIdentifierProcPtr getintidentifier;
NPN_IdentifierIsStringProcPtr identifierisstring;
NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
NPN_IntFromIdentifierProcPtr intfromidentifier;
NPN_CreateObjectProcPtr createobject;
NPN_RetainObjectProcPtr retainobject;
NPN_ReleaseObjectProcPtr releaseobject;
NPN_InvokeProcPtr invoke;
NPN_InvokeDefaultProcPtr invokeDefault;
NPN_EvaluateProcPtr evaluate;
NPN_GetPropertyProcPtr getproperty;
NPN_SetPropertyProcPtr setproperty;
NPN_RemovePropertyProcPtr removeproperty;
NPN_HasPropertyProcPtr hasproperty;
NPN_HasMethodProcPtr hasmethod;
NPN_ReleaseVariantValueProcPtr releasevariantvalue;
NPN_SetExceptionProcPtr setexception;
NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
NPN_EnumerateProcPtr enumerate;
NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
NPN_ConstructProcPtr construct;
NPN_GetValueForURLProcPtr getvalueforurl;
NPN_SetValueForURLProcPtr setvalueforurl;
NPN_GetAuthenticationInfoProcPtr getauthenticationinfo;
NPN_ScheduleTimerProcPtr scheduletimer;
NPN_UnscheduleTimerProcPtr unscheduletimer;
NPN_PopUpContextMenuProcPtr popupcontextmenu;
NPN_ConvertPointProcPtr convertpoint;

} NPNetscapeFuncs;

但是NPN_ReleaseObjectProcPtr(事实上大多数函数)显然没有在mozilla中声明。所以我无法得到任何帮助。

我是否在mozilla中找错了地方寻求帮助?有人知道吗? 提前谢谢!

1 个答案:

答案 0 :(得分:0)

以前没有实现过,但已经使用http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/18620的文档来处理其他事情。希望这有帮助