/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "qtnpapi.h"
#include "qtbrowserplugin.h"
#include "qtbrowserplugin_p.h"
#include <QStatusBar>
#ifndef WINAPI
# ifdef Q_OS_WIN
# define WINAPI __stdcall
# else
# define WINAPI
# endif
#endif
#ifdef Q_WS_X11
# ifdef Bool
# undef Bool
# endif
/*
static void debuginfo(const QString &str)
{
static bool inited = false;
QFile file("/tmp/qnsdebug.txt");
if (file.open(QFile::WriteOnly | QFile::Append)) {
if (!inited) {
file.write("\n\n*** New run started ***\n");
inited = true;
}
file.write(qtNPFactory()->pluginName().toLatin1() + ": " + str.toLatin1() + '\n');
file.close();
}
}
*/
#endif
static QtNPFactory *qNP = 0;
static NPNetscapeFuncs *qNetscapeFuncs = 0;
// The single global plugin
QtNPFactory *qtNPFactory()
{
extern QtNPFactory *qtns_instantiate();
if (!qNP) {
qNP = qtns_instantiate();
}
return qNP;
}
// NPN functions, forwarding to function pointers provided by browser
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
{
Q_ASSERT(qNetscapeFuncs);
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = qNetscapeFuncs->version >> 8; // Major version is in high byte
*netscape_minor = qNetscapeFuncs->version & 0xFF; // Minor version is in low byte
}
#define NPN_Prolog(x) \
Q_ASSERT(qNetscapeFuncs); \
Q_ASSERT(qNetscapeFuncs->x); \
const char *NPN_UserAgent(NPP instance)
{
NPN_Prolog(uagent);
return FIND_FUNCTION_POINTER(NPN_UserAgentFP, qNetscapeFuncs->uagent)(instance);
}
void NPN_Status(NPP instance, const char* message)
{
NPN_Prolog(status);
FIND_FUNCTION_POINTER(NPN_StatusFP, qNetscapeFuncs->status)(instance, message);
}
NPError NPN_GetURL(NPP instance, const char* url, const char* window)
{
NPN_Prolog(geturl);
return FIND_FUNCTION_POINTER(NPN_GetURLFP, qNetscapeFuncs->geturl)(instance, url, window);
}
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
{
if ((qNetscapeFuncs->version & 0xFF) < NPVERS_HAS_NOTIFICATION)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
NPN_Prolog(geturlnotify);
return FIND_FUNCTION_POINTER(NPN_GetURLNotifyFP, qNetscapeFuncs->geturlnotify)(instance, url, window, notifyData);
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
{
if ((qNetscapeFuncs->version & 0xFF) < NPVERS_HAS_NOTIFICATION)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
NPN_Prolog(posturlnotify);
return FIND_FUNCTION_POINTER(NPN_PostURLNotifyFP, qNetscapeFuncs->posturlnotify)(instance, url, window, len, buf, file, notifyData);
}
void* NPN_MemAlloc(uint32 size)
{
NPN_Prolog(memalloc);
return FIND_FUNCTION_POINTER(NPN_MemAllocFP, qNetscapeFuncs->memalloc)(size);
}
void NPN_MemFree(void* ptr)
{
NPN_Prolog(memfree);
FIND_FUNCTION_POINTER(NPN_MemFreeFP, qNetscapeFuncs->memfree)(ptr);
}
uint32 NPN_MemFlush(uint32 size)
{
NPN_Prolog(memflush);
return FIND_FUNCTION_POINTER(NPN_MemFlushFP, qNetscapeFuncs->memflush)(size);
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *ret_value)
{
NPN_Prolog(getvalue);
return FIND_FUNCTION_POINTER(NPN_GetValueFP, qNetscapeFuncs->getvalue)(instance, variable, ret_value);
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *ret_value)
{
NPN_Prolog(setvalue);
return FIND_FUNCTION_POINTER(NPN_SetValueFP, qNetscapeFuncs->setvalue)(instance, variable, ret_value);
}
NPIdentifier NPN_GetStringIdentifier(const char* name)
{
NPN_Prolog(getstringidentifier);
return FIND_FUNCTION_POINTER(NPN_GetStringIdentifierFP, qNetscapeFuncs->getstringidentifier)(name);
}
void NPN_GetStringIdentifiers(const char** names, int32 nameCount, NPIdentifier* identifiers)
{
NPN_Prolog(getstringidentifiers);
FIND_FUNCTION_POINTER(NPN_GetStringIdentifiersFP, qNetscapeFuncs->getstringidentifiers)(names, nameCount, identifiers);
}
NPIdentifier NPN_GetIntIdentifier(int32 intid)
{
NPN_Prolog(getintidentifier);
return FIND_FUNCTION_POINTER(NPN_GetIntIdentifierFP, qNetscapeFuncs->getintidentifier)(intid);
}
bool NPN_IdentifierIsString(NPIdentifier identifier)
{
NPN_Prolog(identifierisstring);
return FIND_FUNCTION_POINTER(NPN_IdentifierIsStringFP, qNetscapeFuncs->identifierisstring)(identifier);
}
char* NPN_UTF8FromIdentifier(NPIdentifier identifier)
{
NPN_Prolog(utf8fromidentifier);
return FIND_FUNCTION_POINTER(NPN_UTF8FromIdentifierFP, qNetscapeFuncs->utf8fromidentifier)(identifier);
}
int32 NPN_IntFromIdentifier(NPIdentifier identifier)
{
NPN_Prolog(intfromidentifier);
return FIND_FUNCTION_POINTER(NPN_IntFromIdentifierFP, qNetscapeFuncs->intfromidentifier)(identifier);
}
NPObject* NPN_CreateObject(NPP npp, NPClass *aClass)
{
NPN_Prolog(createobject);
return FIND_FUNCTION_POINTER(NPN_CreateObjectFP, qNetscapeFuncs->createobject)(npp, aClass);
}
NPObject* NPN_RetainObject(NPObject *obj)
{
NPN_Prolog(retainobject);
return FIND_FUNCTION_POINTER(NPN_RetainObjectFP, qNetscapeFuncs->retainobject)(obj);
}
void NPN_ReleaseObject(NPObject *obj)
{
NPN_Prolog(releaseobject);
FIND_FUNCTION_POINTER(NPN_ReleaseObjectFP, qNetscapeFuncs->releaseobject)(obj);
}
// Scripting implementation (QObject calling JavaScript in browser) - we don't use those
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, int32 argCount, NPVariant *result)
{
NPN_Prolog(invoke);
return FIND_FUNCTION_POINTER(NPN_InvokeFP, qNetscapeFuncs->invoke)(npp, obj, methodName, args, argCount, result);
}
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args, int32 argCount, NPVariant *result)
{
NPN_Prolog(invokedefault);
return FIND_FUNCTION_POINTER(NPN_InvokeDefaultFP, qNetscapeFuncs->invokedefault)(npp, obj, args, ar
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Qt5开发FireFox(NpApi)插件.rar (66个子文件)
使用说明.docx 169KB
Firefox Setup 50.0.1.exe 42.47MB
vcredist_msvc2015_x86.exe 13.79MB
Qt
bin
vcruntime140d.dll 111KB
iconengines
qsvgicond.dll 79KB
npqtplugintest.dll 189KB
libGLESV2d.dll 8.5MB
Qt5Guid.dll 10.63MB
msvcp140d.dll 734KB
计算.html 185B
imageformats
qicod.dll 74KB
qsvgd.dll 58KB
qjpegd.dll 568KB
qgifd.dll 74KB
qtiffd.dll 630KB
qtgad.dll 58KB
qwbmpd.dll 57KB
qwebpd.dll 825KB
qicnsd.dll 94KB
Qt5Widgetsd.dll 8.36MB
platforms
qwindowsd.dll 3.11MB
Qt5Networkd.dll 2.53MB
D3Dcompiler_47.dll 3.31MB
Qt5Svgd.dll 535KB
Qt5Cored.dll 9.79MB
opengl32sw.dll 15.25MB
translations
qt_fi.qm 172KB
qt_fr.qm 162KB
qt_gd.qm 185KB
qt_ru.qm 169KB
qt_ko.qm 128KB
qt_ca.qm 176KB
qt_pl.qm 159KB
qt_de.qm 184KB
qt_bg.qm 161KB
qt_uk.qm 155KB
qt_en.qm 23B
qt_lv.qm 150KB
qt_hu.qm 89KB
qt_sk.qm 123KB
qt_cs.qm 171KB
qt_ja.qm 127KB
qt_da.qm 167KB
qt_ar.qm 156KB
qt_he.qm 135KB
qt_es.qm 161KB
qt_it.qm 157KB
styles
qwindowsvistastyled.dll 289KB
Qt5Sqld.dll 328KB
libEGLd.dll 43KB
ucrtbased.dll 1.43MB
qtbrowserplugin-calc
qtplugintest
qtplugintest.pro 635B
form.h 920B
form.ui 2KB
form.cpp 1KB
trivial.rc 958B
src
qtbrowserplugin.pri 2KB
qtbrowserplugin_x11.cpp 5KB
qtbrowserplugin.h 5KB
qtbrowserplugin_win.cpp 9KB
qtbrowserplugin.cpp 51KB
qtnpapi.h 21KB
qtbrowserplugin_mac.cpp 19KB
qtbrowserplugin_p.h 3KB
qtbrowserplugin.def 80B
qtbrowserpluginax.def 223B
共 66 条
- 1
资源评论
Grateful_Heart
- 粉丝: 4
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功