/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////
//
// Implementation of Netscape entry points (NPN_*)
//
#include "npapi.h"
#include "npfunctions.h"
#ifndef HIBYTE
#define HIBYTE(x) ((((uint32_t)(x)) & 0xff00) >> 8)
#endif
#ifndef LOBYTE
#define LOBYTE(W) ((W) & 0xFF)
#endif
extern NPNetscapeFuncs NPNFuncs;
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = HIBYTE(NPNFuncs.version);
*netscape_minor = LOBYTE(NPNFuncs.version);
}
NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = NPNFuncs.geturlnotify(instance, url, target, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
NPError rv = NPNFuncs.geturl(instance, url, target);
return rv;
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = NPNFuncs.posturlnotify(instance, url, window, len, buf, file, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
{
NPError rv = NPNFuncs.posturl(instance, url, window, len, buf, file);
return rv;
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
NPError rv = NPNFuncs.requestread(stream, rangeList);
return rv;
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.newstream(instance, type, target, stream);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
int32_t NPN_Write(NPP instance, NPStream *stream, int32_t len, void *buffer)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
int32_t rv = 0;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.write(instance, stream, len, buffer);
else
rv = -1;
return rv;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.destroystream(instance, stream, reason);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
void NPN_Status(NPP instance, const char *message)
{
NPNFuncs.status(instance, message);
}
const char* NPN_UserAgent(NPP instance)
{
const char * rv = NULL;
rv = NPNFuncs.uagent(instance);
return rv;
}
void* NPN_MemAlloc(uint32_t size)
{
void * rv = NULL;
rv = NPNFuncs.memalloc(size);
return rv;
}
void NPN_MemFree(void* ptr)
{
NPNFuncs.memfree(ptr);
}
uint32_t NPN_MemFlush(uint32_t size)
{
uint32_t rv = NPNFuncs.memflush(size);
return rv;
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
NPNFuncs.reloadplugins(reloadPages);
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
NPError rv = NPNFuncs.getvalue(instance, variable, value);
return rv;
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
NPError rv = NPNFuncs.setvalue(instance, variable, value);
return rv;
}
void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
{
NPNFuncs.invalidaterect(instance, invalidRect);
}
void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{
NPNFuncs.invalidateregion(instance, invalidRegion);
}
void NPN_ForceRedraw(NPP instance)
{
NPNFuncs.forceredraw(instance);
}
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
{
return NPNFuncs.getstringidentifier(name);
}
void NPN_GetStringIdentifiers(const NPUTF8 **names, uint32_t nameCount,
NPIdentifier *identifiers)
{
return NPNFuncs.getstringidentifiers(names, nameCount, identifiers);
}
NPIdentifier NPN_GetStringIdentifier(int32_t intid)
{
return NPNFuncs.getintidentifier(intid);
}
bool NPN_IdentifierIsString(NPIdentifier identifier)
{
return NPNFuncs.identifierisstring(identifier);
}
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
{
return NPNFuncs.utf8fromidentifier(identifier);
}
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
{
return NPNFuncs.intfromidentifier(identifier);
}
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
{
return NPNFuncs.createobject(npp, aClass);
}
NPObject *NPN_RetainObject(NPObject *obj)
{
return NPNFuncs.retainobject(obj);
}
void NPN_ReleaseObject(NPObject *obj)
{
return NPNFuncs.releaseobject(obj);
}
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
const NPVariant *args, uint32_t argCount, NPVariant *result)
{
return NPNFuncs.invoke(npp, obj, methodName, args, argCount, result);
}
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
return NPNFuncs.invokeDefault(npp, obj, args, argCount, result);
}
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
NPVariant *result)
{
return NPNFuncs.evaluate(npp, obj, script, result);
}
bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
NPVariant *result)
{
return NPNFuncs.getproperty(npp, obj, propertyName, result);
}
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
const NPVariant *value)
{
return NPNFuncs.setproperty(npp, obj, propertyName, value);
}
bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{
return NPNFuncs.removeproperty(npp, obj, propertyName);
}
bool NPN_Enumerate(NPP npp, NPObject *obj, NPIdentifier **identifier,
uint32_t *count)
{
return NPNFuncs.enumerate(npp, obj, identifier,
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
npyufuinput.rar (64个子文件)
npyufuinput
resource.h 1002B
npyufuinput.vcxproj.filters 2KB
PluginObject.h 2KB
Debug
link.28832.read.1.tlog 2B
cl.command.1.tlog 7KB
plugin.obj 97KB
npyufuinput.res 964B
npn_gate.obj 40KB
GetMacAddress.obj 133KB
rc.command.1.tlog 1024B
CL.read.1.tlog 127KB
link.6496.read.1.tlog 2B
vc100.idb 899KB
link.15540.read.1.tlog 2B
mt.read.1.tlog 342B
link.15540.write.1.tlog 2B
npyufuinput.Build.CppClean.log 2KB
link-cvtres.read.1.tlog 2B
link.read.1.tlog 6KB
npyufuinput.vcxprojResolveAssemblyReference.cache 713B
rc.read.1.tlog 3KB
link.6496-cvtres.read.1.tlog 2B
link.write.1.tlog 2KB
CL.write.1.tlog 6KB
npp_gate.obj 91KB
link.6496.write.1.tlog 2B
npyfinput.dll.embed.manifest 406B
vc100.pdb 516KB
link.15540-cvtres.write.1.tlog 2B
DLDialog.obj 27KB
npyfinput.dll.intermediate.manifest 381B
npyfinput_manifest.rc 210B
npyfinput.dll.embed.manifest.res 472B
link.command.1.tlog 3KB
link.15540-cvtres.read.1.tlog 2B
npyfinput.write.1.tlog 4KB
mt.write.1.tlog 342B
np_entry.obj 30KB
link.28832.write.1.tlog 2B
npyfinput.lastbuildstate 60B
link.28832-cvtres.write.1.tlog 2B
link.6496-cvtres.write.1.tlog 2B
npyfinput.Build.CppClean.log 2KB
mt.command.1.tlog 404B
npyufuinput.log 3KB
rc.write.1.tlog 582B
link.28832-cvtres.read.1.tlog 2B
link-cvtres.write.1.tlog 2B
PluginObject.obj 95KB
plugin.h 595B
npyufuinput.aps 34KB
np_entry.cpp 7KB
DLDialog.cpp 830B
npyufuinput.vcxproj 5KB
PluginObject.cpp 5KB
GetMacAddress.h 262B
npp_gate.cpp 7KB
npn_gate.cpp 8KB
npyufuinput.rc 6KB
plugin.cpp 2KB
npyufuinput.vcxproj.user 143B
npyfinput.def 107B
GetMacAddress.cpp 3KB
DLDialog.h 283B
共 64 条
- 1
木头的IT笔记
- 粉丝: 7
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页