fix build against new npapi.h
This commit is contained in:
@@ -37,7 +37,6 @@ INCPRE+=-I$(SOLARINCDIR)$/mozilla$/plugin
|
|||||||
.IF "$(SOLAR_JAVA)" != ""
|
.IF "$(SOLAR_JAVA)" != ""
|
||||||
INCPRE+=-I$(SOLARINCDIR)$/mozilla$/java
|
INCPRE+=-I$(SOLARINCDIR)$/mozilla$/java
|
||||||
INCPRE+=-I$(SOLARINCDIR)$/mozilla$/nspr
|
INCPRE+=-I$(SOLARINCDIR)$/mozilla$/nspr
|
||||||
CDEFS+=-DOJI
|
|
||||||
.ENDIF
|
.ENDIF
|
||||||
|
|
||||||
.IF "$(WITH_MOZILLA)" != "NO"
|
.IF "$(WITH_MOZILLA)" != "NO"
|
||||||
|
@@ -96,6 +96,24 @@ using ::rtl::OUString;
|
|||||||
using ::rtl::OString;
|
using ::rtl::OString;
|
||||||
using ::rtl::OStringToOUString;
|
using ::rtl::OStringToOUString;
|
||||||
|
|
||||||
|
// Move deprecated functions which no longer appear in npapi.h before
|
||||||
|
// their use to avoid errors that they're undeclared at point of use
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
const JRIEnvInterface** SAL_CALL NP_LOADDS NPN_GetJavaEnv()
|
||||||
|
{
|
||||||
|
TRACE( "NPN_GetJavaEnv" );
|
||||||
|
// no java in this program
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
jref SAL_CALL NP_LOADDS NPN_GetJavaPeer( NPP /*instance*/ )
|
||||||
|
{
|
||||||
|
TRACE( "NPN_GetJavaPeer" );
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NPNetscapeFuncs aNPNFuncs =
|
NPNetscapeFuncs aNPNFuncs =
|
||||||
{
|
{
|
||||||
sizeof( NPNetscapeFuncs ),
|
sizeof( NPNetscapeFuncs ),
|
||||||
@@ -112,13 +130,8 @@ NPNetscapeFuncs aNPNFuncs =
|
|||||||
NPN_MemFree,
|
NPN_MemFree,
|
||||||
NPN_MemFlush,
|
NPN_MemFlush,
|
||||||
NPN_ReloadPlugins,
|
NPN_ReloadPlugins,
|
||||||
#ifdef OJI
|
|
||||||
NPN_GetJavaEnv,
|
NPN_GetJavaEnv,
|
||||||
NPN_GetJavaPeer,
|
NPN_GetJavaPeer,
|
||||||
#else
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#endif
|
|
||||||
NPN_GetURLNotify,
|
NPN_GetURLNotify,
|
||||||
NPN_PostURLNotify,
|
NPN_PostURLNotify,
|
||||||
NPN_GetValue,
|
NPN_GetValue,
|
||||||
@@ -238,21 +251,6 @@ extern "C" {
|
|||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OJI
|
|
||||||
const JRIEnvInterface** SAL_CALL NP_LOADDS NPN_GetJavaEnv()
|
|
||||||
{
|
|
||||||
TRACE( "NPN_GetJavaEnv" );
|
|
||||||
// no java in this program
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
jref SAL_CALL NP_LOADDS NPN_GetJavaPeer( NPP /*instance*/ )
|
|
||||||
{
|
|
||||||
TRACE( "NPN_GetJavaPeer" );
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NPError SAL_CALL NP_LOADDS NPN_GetURL( NPP instance, const char* url, const char* window )
|
NPError SAL_CALL NP_LOADDS NPN_GetURL( NPP instance, const char* url, const char* window )
|
||||||
{
|
{
|
||||||
TRACES( "NPN_GetURL", url );
|
TRACES( "NPN_GetURL", url );
|
||||||
|
@@ -562,7 +562,7 @@ void XPlugin_Impl::loadPlugin()
|
|||||||
m_aEncoding).getStr(),
|
m_aEncoding).getStr(),
|
||||||
getNPPInstance(),
|
getNPPInstance(),
|
||||||
m_aPluginMode == PluginMode::FULL ? NP_FULL : NP_EMBED,
|
m_aPluginMode == PluginMode::FULL ? NP_FULL : NP_EMBED,
|
||||||
::sal::static_int_cast< int16, int >( m_nArgs ),
|
::sal::static_int_cast< int16_t, int >( m_nArgs ),
|
||||||
(char**)(m_nArgs ? m_pArgn : NULL),
|
(char**)(m_nArgs ? m_pArgn : NULL),
|
||||||
(char**)(m_nArgs ? m_pArgv : NULL),
|
(char**)(m_nArgs ? m_pArgv : NULL),
|
||||||
NULL );
|
NULL );
|
||||||
@@ -595,8 +595,8 @@ void XPlugin_Impl::loadPlugin()
|
|||||||
|
|
||||||
m_aNPWindow.clipRect.top = 0;
|
m_aNPWindow.clipRect.top = 0;
|
||||||
m_aNPWindow.clipRect.left = 0;
|
m_aNPWindow.clipRect.left = 0;
|
||||||
m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16, sal_Int32 >( aPosSize.Height );
|
m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16_t, sal_Int32 >( aPosSize.Height );
|
||||||
m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16, sal_Int32 >( aPosSize.Width );
|
m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16_t, sal_Int32 >( aPosSize.Width );
|
||||||
m_aNPWindow.type = NPWindowTypeWindow;
|
m_aNPWindow.type = NPWindowTypeWindow;
|
||||||
|
|
||||||
m_aNPWindow.x = 0;
|
m_aNPWindow.x = 0;
|
||||||
@@ -742,7 +742,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
|
|||||||
if( iter != m_aPEventListeners.end() )
|
if( iter != m_aPEventListeners.end() )
|
||||||
pStream->getStream()->notifyData = (*iter)->getNotifyData();
|
pStream->getStream()->notifyData = (*iter)->getNotifyData();
|
||||||
|
|
||||||
uint16 stype = 0;
|
uint16_t stype = 0;
|
||||||
|
|
||||||
// special handling acrobat reader
|
// special handling acrobat reader
|
||||||
// presenting a seekable stream to it does not seem to work correctly
|
// presenting a seekable stream to it does not seem to work correctly
|
||||||
@@ -876,8 +876,8 @@ void XPlugin_Impl::setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_,
|
|||||||
m_aNPWindow.height = nHeight_;
|
m_aNPWindow.height = nHeight_;
|
||||||
m_aNPWindow.clipRect.top = 0;
|
m_aNPWindow.clipRect.top = 0;
|
||||||
m_aNPWindow.clipRect.left = 0;
|
m_aNPWindow.clipRect.left = 0;
|
||||||
m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16, sal_Int32 >( nWidth_ );
|
m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16_t, sal_Int32 >( nWidth_ );
|
||||||
m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16, sal_Int32 >( nHeight_ );
|
m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16_t, sal_Int32 >( nHeight_ );
|
||||||
|
|
||||||
if( getPluginComm() )
|
if( getPluginComm() )
|
||||||
getPluginComm()->NPP_SetWindow( this );
|
getPluginComm()->NPP_SetWindow( this );
|
||||||
|
@@ -59,12 +59,12 @@ public:
|
|||||||
virtual void* NPP_GetJavaClass() = 0;
|
virtual void* NPP_GetJavaClass() = 0;
|
||||||
virtual NPError NPP_Initialize() = 0;
|
virtual NPError NPP_Initialize() = 0;
|
||||||
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
|
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
|
||||||
uint16 mode, int16 argc,
|
uint16_t mode, int16_t argc,
|
||||||
char* argn[], char* argv[],
|
char* argn[], char* argv[],
|
||||||
NPSavedData *saved ) = 0;
|
NPSavedData *saved ) = 0;
|
||||||
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
|
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
|
||||||
NPStream* stream,
|
NPStream* stream,
|
||||||
NPBool seekable, uint16* stype ) = 0;
|
NPBool seekable, uint16_t* stype ) = 0;
|
||||||
virtual void NPP_Print( NPP instance, NPPrint* platformPrint ) = 0;
|
virtual void NPP_Print( NPP instance, NPPrint* platformPrint ) = 0;
|
||||||
virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0;
|
virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0;
|
||||||
virtual void NPP_Shutdown() = 0;
|
virtual void NPP_Shutdown() = 0;
|
||||||
|
@@ -56,11 +56,11 @@ public:
|
|||||||
virtual void* NPP_GetJavaClass();
|
virtual void* NPP_GetJavaClass();
|
||||||
virtual NPError NPP_Initialize();
|
virtual NPError NPP_Initialize();
|
||||||
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
|
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
|
||||||
uint16 mode, int16 argc,
|
uint16_t mode, int16_t argc,
|
||||||
char* argn[], char* argv[], NPSavedData *saved );
|
char* argn[], char* argv[], NPSavedData *saved );
|
||||||
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
|
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
|
||||||
NPStream* stream,
|
NPStream* stream,
|
||||||
NPBool seekable, uint16* stype );
|
NPBool seekable, uint16_t* stype );
|
||||||
virtual void NPP_Print( NPP instance, NPPrint* platformPrint );
|
virtual void NPP_Print( NPP instance, NPPrint* platformPrint );
|
||||||
|
|
||||||
using PluginComm::NPP_SetWindow;
|
using PluginComm::NPP_SetWindow;
|
||||||
|
@@ -608,7 +608,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ )
|
|||||||
pStream->pdata = pStream->ndata = pStream->notifyData = NULL;
|
pStream->pdata = pStream->ndata = pStream->notifyData = NULL;
|
||||||
NPBool* pSeekable = (NPBool*)pMessage->GetBytes();
|
NPBool* pSeekable = (NPBool*)pMessage->GetBytes();
|
||||||
m_aNPWrapStreams.push_back( pStream );
|
m_aNPWrapStreams.push_back( pStream );
|
||||||
uint16 nStype = NP_ASFILE;
|
uint16_t nStype = NP_ASFILE;
|
||||||
NPError aRet = aPluginFuncs.newstream( instance, pType, pStream,
|
NPError aRet = aPluginFuncs.newstream( instance, pType, pStream,
|
||||||
*pSeekable, &nStype );
|
*pSeekable, &nStype );
|
||||||
medDebug( 1, "pluginapp: NPP_NewStream( %p, %s, %p, %s, %p ) returns %d\n"
|
medDebug( 1, "pluginapp: NPP_NewStream( %p, %s, %p, %s, %p ) returns %d\n"
|
||||||
@@ -626,8 +626,8 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ )
|
|||||||
case eNPP_New:
|
case eNPP_New:
|
||||||
{
|
{
|
||||||
char* pType = pMessage->GetString();
|
char* pType = pMessage->GetString();
|
||||||
uint16* pMode = (uint16*)pMessage->GetBytes();
|
uint16_t* pMode = (uint16_t*)pMessage->GetBytes();
|
||||||
int16* pArgc = (int16*)pMessage->GetBytes();
|
int16_t* pArgc = (int16_t*)pMessage->GetBytes();
|
||||||
NPP instance = new NPP_t;
|
NPP instance = new NPP_t;
|
||||||
instance->pdata = instance->ndata = NULL;
|
instance->pdata = instance->ndata = NULL;
|
||||||
sal_uLong nArgnBytes, nArgvBytes;
|
sal_uLong nArgnBytes, nArgvBytes;
|
||||||
|
@@ -411,7 +411,7 @@ NPError UnxPluginComm::NPP_Initialize()
|
|||||||
return aRet;
|
return aRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
|
NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
|
||||||
char* argn[], char* argv[], NPSavedData *saved )
|
char* argn[], char* argv[], NPSavedData *saved )
|
||||||
{
|
{
|
||||||
m_aInstances.push_back(
|
m_aInstances.push_back(
|
||||||
@@ -473,7 +473,7 @@ NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode
|
|||||||
}
|
}
|
||||||
|
|
||||||
NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream,
|
NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream,
|
||||||
NPBool seekable, uint16* stype )
|
NPBool seekable, uint16_t* stype )
|
||||||
{
|
{
|
||||||
NPError aRet = NPERR_GENERIC_ERROR;
|
NPError aRet = NPERR_GENERIC_ERROR;
|
||||||
GET_INSTANCE_RET( aRet );
|
GET_INSTANCE_RET( aRet );
|
||||||
@@ -493,7 +493,7 @@ NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* s
|
|||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
|
|
||||||
aRet = GetNPError( pMes );
|
aRet = GetNPError( pMes );
|
||||||
uint16* pSType = (uint16*)pMes->GetBytes();
|
uint16_t* pSType = (uint16_t*)pMes->GetBytes();
|
||||||
*stype = *pSType;
|
*stype = *pSType;
|
||||||
|
|
||||||
delete [] pSType;
|
delete [] pSType;
|
||||||
|
Reference in New Issue
Block a user