Kaydet (Commit) 4c18af27 authored tarafından Rene Engelhard's avatar Rene Engelhard Kaydeden (comit) Thorsten Behrens

tdf#96398 kill remaining NPAPI support for plugins _inside_ LO

- probably out of date
- links against Gtk2 and thus causes a GTk2 dependency in core packages
- the only serious usecase (Flash) is doomed anyway

Change-Id: I7264ab5eb04c2f4b6c31a815e45b9818209e5ae2
Reviewed-on: https://gerrit.libreoffice.org/20658Reviewed-by: 's avatarDavid Ostrovsky <david@ostrovsky.org>
Reviewed-by: 's avatarBryan Quigley <gquigs@gmail.com>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 57b1cf58
...@@ -145,7 +145,6 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,writer_brand, \ ...@@ -145,7 +145,6 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,writer_brand, \
$(eval $(call gb_Helper_register_executables_for_install,OOO,ooo, \ $(eval $(call gb_Helper_register_executables_for_install,OOO,ooo, \
gengal \ gengal \
$(if $(filter TRUE-TRUE,$(USING_X11)-$(ENABLE_NPAPI_FROM_BROWSER)),pluginapp.bin) \
$(if $(filter WNT,$(OS)),,uri-encode) \ $(if $(filter WNT,$(OS)),,uri-encode) \
ui-previewer \ ui-previewer \
$(if $(filter WNT,$(OS)), \ $(if $(filter WNT,$(OS)), \
...@@ -360,7 +359,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -360,7 +359,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,OPENCL,opencl) \ $(call gb_Helper_optional,OPENCL,opencl) \
passwordcontainer \ passwordcontainer \
pcr \ pcr \
$(if $(ENABLE_NPAPI_FROM_BROWSER),pl) \
pdffilter \ pdffilter \
$(call gb_Helper_optional,SCRIPTING,protocolhandler) \ $(call gb_Helper_optional,SCRIPTING,protocolhandler) \
res \ res \
......
...@@ -151,7 +151,6 @@ export ENABLE_LWP=@ENABLE_LWP@ ...@@ -151,7 +151,6 @@ export ENABLE_LWP=@ENABLE_LWP@
export ENABLE_MACOSX_SANDBOX=@ENABLE_MACOSX_SANDBOX@ export ENABLE_MACOSX_SANDBOX=@ENABLE_MACOSX_SANDBOX@
export ENABLE_MEDIAWIKI=@ENABLE_MEDIAWIKI@ export ENABLE_MEDIAWIKI=@ENABLE_MEDIAWIKI@
export ENABLE_MARIADBC=@ENABLE_MARIADBC@ export ENABLE_MARIADBC=@ENABLE_MARIADBC@
export ENABLE_NPAPI_FROM_BROWSER=@ENABLE_NPAPI_FROM_BROWSER@
export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@ export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@
export ENABLE_ONLINE_UPDATE_MAR=@ENABLE_ONLINE_UPDATE_MAR@ export ENABLE_ONLINE_UPDATE_MAR=@ENABLE_ONLINE_UPDATE_MAR@
export ENABLE_EXTENSION_UPDATE=@ENABLE_EXTENSION_UPDATE@ export ENABLE_EXTENSION_UPDATE=@ENABLE_EXTENSION_UPDATE@
...@@ -416,7 +415,6 @@ export NEON_CFLAGS=$(gb_SPACE)@NEON_CFLAGS@ ...@@ -416,7 +415,6 @@ export NEON_CFLAGS=$(gb_SPACE)@NEON_CFLAGS@
export NEON_LIBS=$(gb_SPACE)@NEON_LIBS@ export NEON_LIBS=$(gb_SPACE)@NEON_LIBS@
export NEON_VERSION=@NEON_VERSION@ export NEON_VERSION=@NEON_VERSION@
export NM=@NM@ export NM=@NM@
export NPAPI_HEADERS_CFLAGS=$(gb_SPACE)@NPAPI_HEADERS_CFLAGS@
export NSS_CFLAGS=$(gb_SPACE)@NSS_CFLAGS@ export NSS_CFLAGS=$(gb_SPACE)@NSS_CFLAGS@
export NSS_LIBS=$(gb_SPACE)@NSS_LIBS@ export NSS_LIBS=$(gb_SPACE)@NSS_LIBS@
export NUMBERTEXT_EXTENSION_PACK=@NUMBERTEXT_EXTENSION_PACK@ export NUMBERTEXT_EXTENSION_PACK=@NUMBERTEXT_EXTENSION_PACK@
...@@ -561,7 +559,6 @@ export SYSTEM_MWAW=@SYSTEM_MWAW@ ...@@ -561,7 +559,6 @@ export SYSTEM_MWAW=@SYSTEM_MWAW@
export SYSTEM_MYSQL_CPPCONN=@SYSTEM_MYSQL_CPPCONN@ export SYSTEM_MYSQL_CPPCONN=@SYSTEM_MYSQL_CPPCONN@
export SYSTEM_MYTHES=@SYSTEM_MYTHES@ export SYSTEM_MYTHES=@SYSTEM_MYTHES@
export SYSTEM_NEON=@SYSTEM_NEON@ export SYSTEM_NEON=@SYSTEM_NEON@
export SYSTEM_NPAPI_HEADERS=@SYSTEM_NPAPI_HEADERS@
export SYSTEM_NSS=@SYSTEM_NSS@ export SYSTEM_NSS=@SYSTEM_NSS@
export SYSTEM_ODBC_HEADERS=@SYSTEM_ODBC_HEADERS@ export SYSTEM_ODBC_HEADERS=@SYSTEM_ODBC_HEADERS@
export SYSTEM_ODFGEN=@SYSTEM_ODFGEN@ export SYSTEM_ODFGEN=@SYSTEM_ODFGEN@
......
...@@ -1951,13 +1951,6 @@ AC_ARG_WITH(system-liblangtag, ...@@ -1951,13 +1951,6 @@ AC_ARG_WITH(system-liblangtag,
[Use liblangtag library already on system.]),, [Use liblangtag library already on system.]),,
[with_system_liblangtag="$with_system_libs"]) [with_system_liblangtag="$with_system_libs"])
AC_ARG_WITH(system-npapi-headers,
AS_HELP_STRING([--with-system-npapi-headers],
[Use NPAPI headers provided by system instead of bundled ones. Used in
extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=TRUE)]),,
[with_system_npapi_headers="$with_system_headers"]
)
AC_ARG_WITH(jpeg-turbo, AC_ARG_WITH(jpeg-turbo,
AS_HELP_STRING([--with-jpeg-turbo], AS_HELP_STRING([--with-jpeg-turbo],
[Use internal libjpeg-turbo library.]),, [Use internal libjpeg-turbo library.]),,
...@@ -8952,56 +8945,6 @@ if test $_os = WINNT -a -z "$ENABLE_RELEASE_BUILD" -a "$with_prebuilt_openssl" = ...@@ -8952,56 +8945,6 @@ if test $_os = WINNT -a -z "$ENABLE_RELEASE_BUILD" -a "$with_prebuilt_openssl" =
BUILD_TYPE="$BUILD_TYPE PREBUILT_OPENSSL" BUILD_TYPE="$BUILD_TYPE PREBUILT_OPENSSL"
fi fi
dnl ===================================================================
dnl Check for system mozilla headers
dnl ===================================================================
HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
AC_MSG_CHECKING([which NPAPI headers to use])
if test "$with_system_npapi_headers" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_NPAPI_HEADERS=TRUE
# First try npapi-sdk:
PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
# Then go with libxul:
if test "x$LOCATED" != "xyes"; then
PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
fi
if test "x$LOCATED" != "xyes"; then
PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
fi
# if still not found bail out
if test "x$LOCATED" != "xyes"; then
AC_MSG_ERROR([npapi.h header file not found])
fi
AC_LANG_PUSH([C])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#define XP_UNIX
#include <npapi.h>
const char* NPP_GetMIMEDescription(void) { return "foo"; }
]])],
[AC_MSG_RESULT([const char*])],
[
AC_MSG_RESULT([char*])
HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
])
CFLAGS=$save_CFLAGS
AC_LANG_POP([C])
NPAPI_HEADERS_CFLAGS=$(printf '%s' "$NPAPI_HEADERS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
else
AC_MSG_RESULT([internal])
dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER
SYSTEM_NPAPI_HEADERS=
fi
AC_SUBST(NPAPI_HEADERS_CFLAGS)
AC_SUBST(SYSTEM_NPAPI_HEADERS)
AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
dnl =================================================================== dnl ===================================================================
dnl Check for system sane dnl Check for system sane
dnl =================================================================== dnl ===================================================================
...@@ -9211,23 +9154,6 @@ else ...@@ -9211,23 +9154,6 @@ else
fi fi
AC_SUBST(ENABLE_HARFBUZZ) AC_SUBST(ENABLE_HARFBUZZ)
dnl ===================================================================
dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
dnl ===================================================================
AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
# Obviously no such thing on iOS or Android. Also not possible when building
# 64-bit OS X code as the plugin code uses QuickTime and Carbon.
if test "$_os" != Android -a "$_os" != iOS -a $_os != Darwin -a \
"$with_x" != "no" -a "$enable_mpl_subset" != yes
then
AC_MSG_RESULT([yes])
ENABLE_NPAPI_FROM_BROWSER=TRUE
else
AC_MSG_RESULT([no])
ENABLE_NPAPI_FROM_BROWSER=
fi
AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
AC_MSG_CHECKING([whether to use X11]) AC_MSG_CHECKING([whether to use X11])
dnl *************************************** dnl ***************************************
dnl testing for X libraries and includes... dnl testing for X libraries and includes...
...@@ -9263,10 +9189,6 @@ if test "$USING_X11" = TRUE; then ...@@ -9263,10 +9189,6 @@ if test "$USING_X11" = TRUE; then
AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])], AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
[#include <X11/Intrinsic.h>]) [#include <X11/Intrinsic.h>])
# ENABLE_NPAPI_FROM_BROWSER requires Xt library
AC_CHECK_LIB([Xt], [XtToolkitInitialize], [:],
[AC_MSG_ERROR(Xt library not found)])
dnl =================================================================== dnl ===================================================================
dnl Check for extension headers dnl Check for extension headers
dnl =================================================================== dnl ===================================================================
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
$(eval $(call gb_Executable_Executable,pluginapp.bin))
$(eval $(call gb_Executable_use_external,pluginapp.bin,npapi_headers))
$(eval $(call gb_Executable_set_include,pluginapp.bin,\
$$(INCLUDE) \
-I$(SRCDIR)/extensions/source/plugin/inc \
))
$(eval $(call gb_Executable_use_sdk_api,pluginapp.bin))
$(eval $(call gb_Executable_add_exception_objects,pluginapp.bin,\
extensions/source/plugin/unx/npwrap \
extensions/source/plugin/unx/npnapi \
))
$(eval $(call gb_Executable_use_static_libraries,pluginapp.bin,\
plugcon \
))
$(eval $(call gb_Executable_use_libraries,pluginapp.bin,\
sal \
))
ifeq ($(filter-out FREEBSD NETBSD OPENBSD DRAGONFLY,$(OS)),)
$(eval $(call gb_Executable_add_libs,pluginapp.bin,\
-lXt \
-lXext \
-lX11 \
))
else ifeq ($(OS),AIX)
$(eval $(call gb_Executable_add_libs,pluginapp.bin,\
-lXpm \
-lXmu \
-lXt \
-lXext \
-lX11 \
-ldl \
))
else
$(eval $(call gb_Executable_add_libs,pluginapp.bin,\
-lXt \
-lXext \
-lX11 \
-ldl \
))
endif
ifeq ($(ENABLE_GTK),TRUE)
$(eval $(call gb_Executable_use_externals,pluginapp.bin,\
gthread \
gtk \
))
endif
# vim:set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
$(eval $(call gb_Library_Library,pl))
$(eval $(call gb_Library_set_componentfile,pl,extensions/source/plugin/pl))
$(eval $(call gb_Library_use_externals,pl,\
boost_headers \
npapi_headers \
))
$(eval $(call gb_Library_set_include,pl,\
$$(INCLUDE) \
-I$(SRCDIR)/extensions/source/plugin/inc \
))
$(eval $(call gb_Library_use_sdk_api,pl))
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_Library_add_defs,pl,\
-DOJI \
))
endif # ENABLE_JAVA=YES
ifeq ($(OS),SOLARIS)
$(eval $(call gb_Library_add_libs,pl,\
-lsocket \
))
endif # OS=SOLARIS
ifeq ($(OS),WNT)
$(eval $(call gb_Library_use_system_win32_libs,pl,\
advapi32 \
ole32 \
version \
))
$(eval $(call gb_Library_add_exception_objects,pl,\
extensions/source/plugin/win/winmgr \
extensions/source/plugin/win/sysplug \
))
else ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_objcxxobjects,pl,\
extensions/source/plugin/aqua/macmgr \
extensions/source/plugin/aqua/sysplug \
))
$(eval $(call gb_Library_use_system_darwin_frameworks,pl,\
Cocoa \
Carbon \
CoreFoundation \
))
else
ifeq ($(ENABLE_GTK),TRUE)
$(eval $(call gb_Library_add_defs,pl,\
-DENABLE_GTK \
))
$(eval $(call gb_Library_use_external,pl,gtk))
endif # ENABLE_GTK=TRUE
$(eval $(call gb_Library_add_exception_objects,pl,\
extensions/source/plugin/unx/nppapi \
extensions/source/plugin/unx/sysplug \
extensions/source/plugin/unx/unxmgr \
))
$(eval $(call gb_Library_use_static_libraries,pl,\
plugcon \
))
$(eval $(call gb_Library_add_libs,pl,\
-lX11 \
))
endif
$(eval $(call gb_Library_use_libraries,pl,\
tk \
vcl \
svl \
utl \
tl \
comphelper \
ucbhelper \
cppuhelper \
cppu \
sal \
salhelper \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_add_exception_objects,pl,\
extensions/source/plugin/base/context \
extensions/source/plugin/base/evtlstnr \
extensions/source/plugin/base/manager \
extensions/source/plugin/base/multiplx \
extensions/source/plugin/base/nfuncs \
extensions/source/plugin/base/plcom \
extensions/source/plugin/base/plctrl \
extensions/source/plugin/base/plmodel \
extensions/source/plugin/base/service \
extensions/source/plugin/base/xplugin \
))
# vim:set noet sw=4 ts=4:
...@@ -94,23 +94,6 @@ endif # DISABLE_ATL ...@@ -94,23 +94,6 @@ endif # DISABLE_ATL
endif # WNT endif # WNT
ifeq ($(ENABLE_NPAPI_FROM_BROWSER),TRUE)
$(eval $(call gb_Module_add_targets,extensions,\
Library_pl \
))
ifneq ($(OS),WNT)
ifneq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,extensions,\
StaticLibrary_plugcon \
Executable_pluginapp.bin \
))
endif
endif
endif # ENABLE_NPAPI_FROM_BROWSER=TRUE
ifeq ($(OS),MACOSX) ifeq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,extensions,\ $(eval $(call gb_Module_add_targets,extensions,\
Library_OOoSpotlightImporter \ Library_OOoSpotlightImporter \
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifeq ($(OS),WNT)
$(error only for UNX)
endif
$(eval $(call gb_StaticLibrary_StaticLibrary,plugcon))
$(eval $(call gb_StaticLibrary_use_externals,plugcon,\
boost_headers \
npapi_headers \
))
$(eval $(call gb_StaticLibrary_set_include,plugcon,\
$$(INCLUDE) \
-I$(SRCDIR)/extensions/source/plugin/inc \
))
$(eval $(call gb_StaticLibrary_use_api,plugcon,\
offapi \
udkapi \
))
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_StaticLibrary_add_defs,plugcon,\
-DOJI \
))
endif # ENABLE_JAVA=YES
ifeq ($(ENABLE_GTK),TRUE)
$(eval $(call gb_StaticLibrary_add_defs,plugcon,\
-DENABLE_GTK \
))
$(eval $(call gb_StaticLibrary_use_external,plugcon,gtk))
# Gtk uses cairo, and if we build internal cairo, the linker could
# pick up our cairo libs before they're fully ready, causing problems
# (e.g. using our libpixman and system libcairo). Depend on cairo
# to delay build until cairo is done.
ifeq ($(SYSTEM_CAIRO),)
$(eval $(call gb_StaticLibrary_use_external,plugcon,cairo))
endif
endif # ENABLE_GTK=TRUE
$(eval $(call gb_StaticLibrary_add_exception_objects,plugcon,\
extensions/source/plugin/unx/mediator \
extensions/source/plugin/unx/plugcon \
))
# vim:set noet sw=4 ts=4:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifdef AIX
#define _LINUX_SOURCE_COMPAT
#include <sys/timer.h>
#undef _LINUX_SOURCE_COMPAT
#endif
#ifdef WNT
#include <prewin.h>
#include <postwin.h>
#endif
#include <cstdarg>
#include <plugin/impl.hxx>
PluginEventListener::PluginEventListener( XPlugin_Impl* pPlugin,
const char* url,
const char* normurl,
void* notifyData ) :
m_pPlugin( pPlugin ),
m_xPlugin( pPlugin ),
m_pUrl( strdup( url ) ),
m_pNormalizedUrl( strdup( normurl ) ),
m_pNotifyData( notifyData )
{
}
PluginEventListener::~PluginEventListener()
{
if( m_pUrl )
free( m_pUrl );
if( m_pNormalizedUrl )
free( m_pNormalizedUrl );
}
void PluginEventListener::disposing( const css::lang::EventObject& /*rEvt*/ ) throw(std::exception)
{
m_pPlugin->getPluginComm()->
NPP_URLNotify( &m_pPlugin->getNPPInstance(),
m_pUrl,
NPRES_DONE,
m_pNotifyData );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifdef AIX
#define _LINUX_SOURCE_COMPAT
#include <sys/timer.h>
#undef _LINUX_SOURCE_COMPAT
#endif
#ifdef WNT
#include <prewin.h>
#include <postwin.h>
#endif
#include <cstdarg>
#include <comphelper/fileurl.hxx>
#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
#include "plugin/impl.hxx"
#include "osl/mutex.hxx"
#include "unotools/pathoptions.hxx"
#include "vcl/configsettings.hxx"
#include "com/sun/star/container/XEnumerationAccess.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/container/XEnumeration.hpp"
#include "com/sun/star/container/XElementAccess.hpp"
#include "com/sun/star/container/XIndexAccess.hpp"
#include "com/sun/star/loader/XImplementationLoader.hpp"
#include <cppuhelper/supportsservice.hxx>
PluginManager* PluginManager::pManager = nullptr;
PluginManager& PluginManager::get()
{
if( ! pManager )
pManager = new PluginManager();
return *pManager;
}
void PluginManager::setServiceFactory( const Reference< css::lang::XMultiServiceFactory >& xFactory )
{
PluginManager& rManager = get();
if( ! rManager.m_xSMgr.is() )
rManager.m_xSMgr = xFactory;
}
PluginManager::PluginManager()
{
}
const Sequence< OUString >& PluginManager::getAdditionalSearchPaths()
{
static Sequence< OUString > aPaths;
if( ! aPaths.getLength() )
{
SvtPathOptions aOptions;
OUString aPluginPath( aOptions.GetPluginPath() );
if( !aPluginPath.isEmpty() )
{
sal_Int32 nPaths = comphelper::string::getTokenCount(aPluginPath, ';');
aPaths.realloc( nPaths );
for( sal_Int32 i = 0; i < nPaths; i++ )
aPaths.getArray()[i] = aPluginPath.getToken(i, ';');
}
}
return aPaths;
}
Reference< XInterface > SAL_CALL PluginManager_CreateInstance( const Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( Exception )
{
Reference< XInterface > xService = *new XPluginManager_Impl( comphelper::getComponentContext(rSMgr) );
return xService;
}
// css::lang::XServiceInfo
OUString XPluginManager_Impl::getImplementationName() throw( )
{
return getImplementationName_Static();
}
// css::lang::XServiceInfo
sal_Bool XPluginManager_Impl::supportsService(const OUString& ServiceName) throw( )
{
return cppu::supportsService(this, ServiceName);
}
// css::lang::XServiceInfo
Sequence< OUString > XPluginManager_Impl::getSupportedServiceNames() throw( )
{
return getSupportedServiceNames_Static();
}
// XPluginManager_Impl
Sequence< OUString > XPluginManager_Impl::getSupportedServiceNames_Static() throw( )
{
Sequence<OUString> aSNS { "com.sun.star.plugin.PluginManager" };
return aSNS;
}
XPluginManager_Impl::XPluginManager_Impl( const Reference< css::uno::XComponentContext > & rxContext )
: m_xContext( rxContext )
{
PluginManager::setServiceFactory( Reference< css::lang::XMultiServiceFactory>(rxContext->getServiceManager(), UNO_QUERY_THROW) );
}
XPluginManager_Impl::~XPluginManager_Impl()
{
}
XPlugin_Impl* XPluginManager_Impl::getXPluginFromNPP( NPP instance )
{
::std::list<XPlugin_Impl*>::iterator iter;
for( iter = PluginManager::get().getPlugins().begin();
iter != PluginManager::get().getPlugins().end(); ++iter )
{
if( &(*iter)->getNPPInstance() == instance )
return *iter;
}
return nullptr;
}
XPlugin_Impl* XPluginManager_Impl::getPluginImplementation( const Reference< css::plugin::XPlugin >& plugin )
{
::std::list<XPlugin_Impl*>::iterator iter;
for( iter = PluginManager::get().getPlugins().begin();
iter != PluginManager::get().getPlugins().end(); ++iter )
{
if( plugin == Reference< css::plugin::XPlugin >((*iter)) )
return *iter;
}
return nullptr;
}
Sequence<css::plugin::PluginDescription> XPluginManager_Impl::getPluginDescriptions()
throw (RuntimeException, std::exception)
{
Sequence<css::plugin::PluginDescription> aRet;
vcl::SettingsConfigItem* pCfg = vcl::SettingsConfigItem::get();
OUString aVal( pCfg->getValue( "BrowserPlugins",
"Disabled" ) );
if( ! aVal.toBoolean() )
{
aRet = impl_getPluginDescriptions();
}
return aRet;
}
Reference< css::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< css::plugin::XPluginContext >& acontext, sal_Int16 mode, const Sequence< OUString >& argn, const Sequence< OUString >& argv, const css::plugin::PluginDescription& plugintype)
throw( RuntimeException,css::plugin::PluginException, std::exception )
{
XPlugin_Impl* pImpl = new XPlugin_Impl( Reference< css::lang::XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW) );
pImpl->setPluginContext( acontext );
PluginManager::get().getPlugins().push_back( pImpl );
pImpl->initInstance( plugintype,
argn,
argv,
mode );
return pImpl;
}
Reference< css::plugin::XPlugin > XPluginManager_Impl::createPluginFromURL( const Reference< css::plugin::XPluginContext > & acontext, sal_Int16 mode, const Sequence< OUString >& argn, const Sequence< OUString >& argv, const Reference< css::awt::XToolkit > & toolkit, const Reference< css::awt::XWindowPeer > & parent, const OUString& url ) throw (RuntimeException, std::exception)
{
XPlugin_Impl* pImpl = new XPlugin_Impl( Reference< css::lang::XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW) );
Reference< css::plugin::XPlugin > xRef = pImpl;
pImpl->setPluginContext( acontext );
PluginManager::get().getPlugins().push_back( pImpl );
pImpl->initInstance( url,
argn,
argv,
mode );
pImpl->createPeer( toolkit, parent );
pImpl->provideNewStream( pImpl->getDescription().Mimetype,
Reference< css::io::XActiveDataSource >(),
url,
0, 0, comphelper::isFileUrl(url) );
if( ! pImpl->getPluginComm() )
{
pImpl->dispose();
xRef = nullptr;
}
return xRef;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifdef AIX
#define _LINUX_SOURCE_COMPAT
#include <sys/timer.h>
#undef _LINUX_SOURCE_COMPAT
#endif
#ifdef WNT
#include <prewin.h>
#include <postwin.h>
#endif
#ifdef SOLARIS
#include <limits>
#endif
#include <cstdarg>
#include <osl/file.hxx>
#include <plugin/impl.hxx>
PluginComm::PluginComm( const OString& rLibName, bool bReusable ) :
m_nRefCount( 0 ),
m_aLibName( rLibName )
{
if( bReusable )
PluginManager::get().getPluginComms().push_back( this );
}
PluginComm::~PluginComm()
{
PluginManager::get().getPluginComms().remove( this );
while( m_aFilesToDelete.size() )
{
OUString aFile( m_aFilesToDelete.front() );
m_aFilesToDelete.pop_front();
osl::FileBase::getFileURLFromSystemPath( aFile, aFile );
osl::File::remove( aFile );
}
}
NPError PluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl )
{
return NPP_SetWindow( &i_pImpl->getNPPInstance(), &i_pImpl->getNPWindow() );
}
NPError PluginComm::NPP_Destroy( XPlugin_Impl* i_pImpl, NPSavedData** save )
{
return NPP_Destroy( &i_pImpl->getNPPInstance(), save );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <plugin/model.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <cppuhelper/queryinterface.hxx>
using namespace com::sun::star::uno;
Reference< XInterface > SAL_CALL PluginModel_CreateInstance( const Reference< css::lang::XMultiServiceFactory > & ) throw( Exception )
{
Reference< XInterface > xService = *new PluginModel();
return xService;
}
Any PluginModel::queryAggregation( const Type& type ) throw( RuntimeException, std::exception )
{
Any aRet( ::cppu::queryInterface( type,
static_cast< css::lang::XComponent* >(this),
static_cast< css::io::XPersistObject* >(this ),
static_cast< css::awt::XControlModel* >(this),
static_cast< css::beans::XPropertySet* >(this),
static_cast< css::beans::XMultiPropertySet* >(this),
static_cast< css::beans::XFastPropertySet* >(this)
) );
return aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( type );
}
// XPluginManager_Impl
Sequence< OUString > PluginModel::getSupportedServiceNames_Static() throw()
{
Sequence<OUString> aSNS { "com.sun.star.plugin.PluginModel" };
return aSNS;
}
static const char* aCreationURL = "URL";
static const char* aMime = "TYPE";
static ::osl::Mutex aPropertyMutex;
static css::beans::Property aProps[] =
{
css::beans::Property(
OUString::createFromAscii( aMime ),
1,
::cppu::UnoType<OUString>::get(),
css::beans::PropertyAttribute::BOUND ),
css::beans::Property(
OUString::createFromAscii( aCreationURL ),
2,
::cppu::UnoType<OUString>::get(),
css::beans::PropertyAttribute::BOUND )
};
PluginModel::PluginModel() :
BroadcasterHelperHolder( aPropertyMutex ),
OPropertySetHelper( m_aHelper ),
OPropertyArrayHelper( aProps, 2 )
{
}
PluginModel::PluginModel(const OUString& rURL, const OUString& rMimeType ) :
BroadcasterHelperHolder( aPropertyMutex ),
OPropertySetHelper( m_aHelper ),
OPropertyArrayHelper( aProps, 2 ),
m_aCreationURL( rURL ),
m_aMimeType( rMimeType )
{
}
PluginModel::~PluginModel()
{
}
Reference< css::beans::XPropertySetInfo > PluginModel::getPropertySetInfo() throw(std::exception)
{
static Reference< css::beans::XPropertySetInfo > aInfo =
createPropertySetInfo( *this );
return aInfo;
}
::cppu::IPropertyArrayHelper& PluginModel::getInfoHelper()
{
return *this;
}
sal_Bool PluginModel::convertFastPropertyValue( Any & rConvertedValue,
Any & rOldValue,
sal_Int32 nHandle,
const Any& rValue ) throw()
{
if( nHandle == 1 || nHandle == 2 )
{
if( rValue.getValueTypeClass() == TypeClass_STRING )
{
rConvertedValue = rValue;
if( nHandle == 2 )
rOldValue <<= m_aCreationURL;
else if( nHandle == 1 )
rOldValue <<= m_aMimeType;
return sal_True;
}
}
return sal_False;
}
void PluginModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle,
const Any& rValue )
throw(css::uno::Exception, std::exception)
{
if( rValue.getValueTypeClass() == TypeClass_STRING ) // FIXME wrong type!
{
if( nHandle == 2 )
rValue >>= m_aCreationURL;
else if( nHandle == 1 )
rValue >>= m_aMimeType;
}
else
throw css::lang::IllegalArgumentException();
}
void PluginModel::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const throw()
{
if( nHandle == 2 )
rValue <<= m_aCreationURL;
else if( nHandle == 1 )
rValue <<= m_aMimeType;
}
//---- css::lang::XComponent ----------------------------------------------------------------------------------
void PluginModel::addEventListener( const Reference< css::lang::XEventListener > & l ) throw(std::exception)
{
m_aDisposeListeners.push_back( l );
}
//---- css::lang::XComponent ----------------------------------------------------------------------------------
void PluginModel::removeEventListener( const Reference< css::lang::XEventListener > & l ) throw(std::exception)
{
m_aDisposeListeners.remove( l );
}
//---- css::lang::XComponent ----------------------------------------------------------------------------------
void PluginModel::dispose() throw(std::exception)
{
// send disposing events
css::lang::EventObject aEvt;
aEvt.Source = static_cast<cppu::OWeakObject*>(this);
::std::list< Reference< css::lang::XEventListener > > aLocalListeners = m_aDisposeListeners;
for( ::std::list< Reference< css::lang::XEventListener > >::iterator it = aLocalListeners.begin();
it != aLocalListeners.end(); ++it )
(*it)->disposing( aEvt );
m_aDisposeListeners.clear();
disposing();
}
// css::io::XPersistObject
OUString PluginModel::getServiceName() throw(std::exception)
{
return OUString("com.sun.star.plugin.PluginModel");
}
void PluginModel::write(const Reference< css::io::XObjectOutputStream > & OutStream) throw(std::exception)
{
OutStream->writeUTF( m_aCreationURL );
}
void PluginModel::read(const Reference< css::io::XObjectInputStream > & InStream) throw(std::exception)
{
m_aCreationURL = InStream->readUTF();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifdef AIX
#define _LINUX_SOURCE_COMPAT
#include <sys/timer.h>
#undef _LINUX_SOURCE_COMPAT
#endif
#ifdef WNT
#include <prewin.h>
#include <postwin.h>
#endif
#include <cstdarg>
#include <plugin/impl.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/container/XSet.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <uno/dispatcher.h>
#include <uno/mapping.hxx>
#include <cppuhelper/factory.hxx>
using namespace cppu;
extern "C" {
SAL_DLLPUBLIC_EXPORT void* SAL_CALL pl_component_getFactory(
const sal_Char* pImplementationName,
void* pXUnoSMgr,
void* /*pXUnoKey*/
)
{
void* pRet = nullptr;
OUString aImplName( OUString::createFromAscii( pImplementationName ) );
if( pXUnoSMgr )
{
Reference< css::lang::XMultiServiceFactory > xMgr(
static_cast< css::lang::XMultiServiceFactory* >( pXUnoSMgr )
);
Reference< css::lang::XSingleServiceFactory > xFactory;
if( aImplName.equals( XPluginManager_Impl::getImplementationName_Static() ) )
{
xFactory = ::cppu::createSingleFactory(
xMgr, aImplName, PluginManager_CreateInstance,
XPluginManager_Impl::getSupportedServiceNames_Static() );
}
else if( aImplName.equals( PluginModel::getImplementationName_Static() ) )
{
xFactory = ::cppu::createSingleFactory(
xMgr, aImplName, PluginModel_CreateInstance,
PluginModel::getSupportedServiceNames_Static() );
}
if( xFactory.is() )
{
xFactory->acquire();
pRet = xFactory.get();
}
}
return pRet;
}
} /* extern "C" */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_AQUA_SYSPLUG_HXX
#define INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_AQUA_SYSPLUG_HXX
#include <unistd.h>
#include <list>
#include <map>
#include <algorithm>
#include "premac.h"
#include <Carbon/Carbon.h>
#include <Security/cssmconfig.h>
#include "postmac.h"
#undef uint32
#define XP_MAC
#include "npapi.h"
#include "npsdk/npupp.h"
#include "plugin/plcom.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/threadex.hxx"
#include "vcl/timer.hxx"
#include "osl/module.h"
#ifdef __OBJC__
@class NSView;
#else
class NSView;
#endif
class XPlugin_Impl;
namespace plugstringhelper
{
OUString getString( CFStringRef i_xString );
OUString getString( CFURLRef i_xURL );
CFMutableStringRef createString( const OUString& i_rString );
CFURLRef createURL( const OUString& i_rString );
OUString getURLFromPath( const OUString& i_rPath );
CFURLRef createURLFromPath( const OUString& i_rPath );
OUString CFURLtoOSLURL( CFURLRef i_xURL );
}
class MacPluginComm :
public PluginComm,
public vcl::SolarThreadExecutor
{
enum CallType {
eNPP_Destroy,
eNPP_DestroyStream,
eNPP_GetJavaClass,
eNPP_Initialize,
eNPP_New,
eNPP_NewStream,
eNPP_Print,
eNPP_SetWindow,
eNPP_Shutdown,
eNPP_StreamAsFile,
eNPP_URLNotify,
eNPP_Write,
eNPP_WriteReady,
eNPP_GetValue,
eNPP_SetValue,
eNPP_HandleEvent,
eNP_Initialize
};
void* m_aArgs[ 8 ];
CallType m_eCall;
virtual long doIt();
public:
MacPluginComm( const OUString& rMIME, const OUString& rName, NSView* pView );
virtual ~MacPluginComm();
// FIXME:
// this actually should be from the NP headers
// but currently we have too old a version
// changes this when we have updated our headers
typedef struct NP_CGContext
{
CGContextRef context;
WindowRef window;
} NP_CGContext;
public:
virtual NPError NPP_Destroy( NPP instance, NPSavedData** save );
virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason );
virtual NPError NPP_Initialize();
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData *saved );
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16_t* stype );
virtual void NPP_Print( NPP instance, NPPrint* platformPrint );
virtual NPError NPP_SetWindow( NPP instance, NPWindow* window );
virtual void NPP_Shutdown();
virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname );
virtual void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData );
virtual int32_t NPP_Write( NPP instance, NPStream* stream, int32_t offset,
int32_t len, void* buffer );
virtual int32_t NPP_WriteReady( NPP instance, NPStream* stream );
virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_value );
virtual int16_t NPP_HandleEvent( NPP instance, void* event );
virtual NPError NPP_SetWindow( XPlugin_Impl* );
virtual NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save );
void drawView( XPlugin_Impl* );
private:
sal_Bool retrieveFunction( const char* i_pName, void** i_ppFunc ) const;
DECL_LINK_TYPED( NullTimerHdl, Timer*, void );
private:
CFBundleRef m_xBundle;
oslModule m_hPlugLib;
NPPluginFuncs m_aNPPfuncs;
// timer for sending nullEvents
AutoTimer* m_pNullTimer;
std::list< XPlugin_Impl* > m_aNullEventClients;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCOM_HXX
#define INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCOM_HXX
#include <list>
class XPlugin_Impl;
class PluginComm
{
protected:
int m_nRefCount;
OString m_aLibName;
std::list< OUString > m_aFilesToDelete;
public:
PluginComm( const OString& rLibName, bool bReusable = true );
virtual ~PluginComm();
void addRef() { m_nRefCount++; }
void decRef() { m_nRefCount--; if( ! m_nRefCount ) delete this; }
const OString& getLibName() { return m_aLibName; }
void addFileToDelete( const OUString& filename )
{ m_aFilesToDelete.push_back( filename ); }
virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ) = 0;
virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream,
NPError reason ) = 0;
virtual NPError NPP_Initialize() = 0;
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
uint16_t mode, int16_t argc,
char* argn[], char* argv[],
NPSavedData *saved ) = 0;
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
NPStream* stream,
NPBool seekable, uint16_t* stype ) = 0;
virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0;
virtual void NPP_Shutdown() = 0;
virtual void NPP_StreamAsFile( NPP instance, NPStream* stream,
const char* fname ) = 0;
virtual void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData ) = 0;
virtual int32_t NPP_Write( NPP instance, NPStream* stream, int32_t offset,
int32_t len, void* buffer ) = 0;
virtual int32_t NPP_WriteReady( NPP instance, NPStream* stream ) = 0;
NPError NPP_SetWindow( XPlugin_Impl* );
NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save );
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="pl" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.extensions.PluginManager">
<service name="com.sun.star.plugin.PluginManager"/>
</implementation>
<implementation name="com.sun.star.extensions.PluginModel">
<service name="com.sun.star.plugin.PluginModel"/>
</implementation>
</component>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Netscape Plugin SDK. Header to build Mozilla plugins.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This folder contains Mozilla headers related to plugin development. The original version of the files were taken from Mozilla1.0 tarball.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment