summaryrefslogtreecommitdiff
path: root/np_sdk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-11-12 16:59:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-11-12 17:07:26 +0100
commit9081e07c9c92267d86a90752b28bd42b592782a8 (patch)
tree0c900fba52aecafa6b238ee8acdec9bf395a2a97 /np_sdk
parentce629d95a6eadea43a3b5b4208f3965767f9fcea (diff)
Enable NPP_Initialize/Shutdown again
...calling which had erroneously been dropped in bdead69dd3c947743907681c8a2f16ca1f50cd9c "Add switch for system/internal npapi.h." This makes the npsoplugin browser plugin work again. (Also, init write_fd to -1 instead of 0, so that a missing do_init_pipe does not accidentally cause writing to write_fd succeed in writing to stdin.) Change-Id: Iced734512a43c8dfea46088f7ac16f159e7dd807
Diffstat (limited to 'np_sdk')
-rw-r--r--np_sdk/Package_inc.mk1
-rw-r--r--np_sdk/mozsrc/npunix.c4
-rw-r--r--np_sdk/mozsrc/npwin.cxx4
-rw-r--r--np_sdk/mozsrc/plugin.h44
4 files changed, 51 insertions, 2 deletions
diff --git a/np_sdk/Package_inc.mk b/np_sdk/Package_inc.mk
index 841b1bd33b4e..2a656b9e0ab1 100644
--- a/np_sdk/Package_inc.mk
+++ b/np_sdk/Package_inc.mk
@@ -31,5 +31,6 @@ $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri.h,mozsrc/jri.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri_md.h,mozsrc/jri_md.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jritypes.h,mozsrc/jritypes.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npupp.h,mozsrc/npupp.h))
+$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/plugin.h,mozsrc/plugin.h))
# vim: set noet sw=4 ts=4:
diff --git a/np_sdk/mozsrc/npunix.c b/np_sdk/mozsrc/npunix.c
index 0b5ff3876161..24ef766873dd 100644
--- a/np_sdk/mozsrc/npunix.c
+++ b/np_sdk/mozsrc/npunix.c
@@ -58,6 +58,7 @@
#include <stdio.h>
#include "npapi.h"
#include "npupp.h"
+#include "plugin.h"
/*
* Define PLUGIN_TRACE to have the wrapper functions print
@@ -485,7 +486,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->javaClass = Private_GetJavaClass();
#endif
- err = NPERR_NO_ERROR;
+ err = NPP_Initialize();
}
return err;
@@ -502,4 +503,5 @@ SAL_DLLPUBLIC_EXPORT void
NP_Shutdown(void)
{
PLUGINDEBUGSTR("NP_Shutdown");
+ NPP_Shutdown();
}
diff --git a/np_sdk/mozsrc/npwin.cxx b/np_sdk/mozsrc/npwin.cxx
index 204f5d159c4f..890533a8c6bd 100644
--- a/np_sdk/mozsrc/npwin.cxx
+++ b/np_sdk/mozsrc/npwin.cxx
@@ -37,6 +37,7 @@
#include "npapi.h"
#include "npupp.h"
+#include "plugin.h"
//\\// DEFINE
#define NP_EXPORT
@@ -149,7 +150,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
}
#endif
- return NPERR_NO_ERROR;
+ return NPP_Initialize;
}
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
@@ -163,6 +164,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
void WINAPI NP_EXPORT
NP_Shutdown()
{
+ NPP_Shutdown();
g_pNavigatorFuncs = NULL;
}
diff --git a/np_sdk/mozsrc/plugin.h b/np_sdk/mozsrc/plugin.h
new file mode 100644
index 000000000000..67e049e4b5f6
--- /dev/null
+++ b/np_sdk/mozsrc/plugin.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
+#define INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
+
+#include "npapi.h"
+
+/* OpenOffice.org/LibreOffice modified the implementations of NP_Initialize and
+ NP_Shutdown in np_sdk/mozsrc/ to call NPP_Initialize and NPP_Shutdown, resp.,
+ defined in extensions/source/nsplugin/source/npshell.cxx:
+*/
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+NPError NPP_Initialize(void);
+
+void NPP_Shutdown(void);
+
+#if defined __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */