Export public plugin functions.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
Slávek Banko 4 years ago
parent 0960d99962
commit 326fe7986c
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668

@ -14,9 +14,14 @@
#define XP_UNIX 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include "npapi.h"
#include "npupp.h"
#include "plugin-exports.h"
/*
* Define PLUGIN_TRACE to have the wrapper functions print
@ -251,7 +256,7 @@ Private_Print(NPP instance, NPPrint* platformPrint)
* - Netscape uses the return value to identify when an object instance
* of this plugin should be created.
*/
char *
PLUGIN_EXPORT char *
NP_GetMIMEDescription(void)
{
return NPP_GetMIMEDescription();
@ -263,7 +268,7 @@ NP_GetMIMEDescription(void)
* - Interfaces with plugin to get values for predefined variables
* that the navigator needs.
*/
NPError
PLUGIN_EXPORT NPError
NP_GetValue(void *future, NPPVariable variable, void *value)
{
return NPP_GetValue(future, variable, value);
@ -286,7 +291,7 @@ NP_GetValue(void *future, NPPVariable variable, void *value)
* library will use this function table to call the plugin.
*
*/
NPError
PLUGIN_EXPORT NPError
NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
{
NPError err = NPERR_NO_ERROR;
@ -376,7 +381,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
* the last object of this kind has been destroyed.
*
*/
NPError
PLUGIN_EXPORT NPError
NP_Shutdown(void)
{
PLUGINDEBUGSTR("NP_Shutdown");

@ -0,0 +1,34 @@
/*
Copyright (c) 2020 TDE Team
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _PLUGIN_EXPORTS_H_
#define _PLUGIN_EXPORTS_H_
#ifdef __KDE_HAVE_GCC_VISIBILITY
#define PLUGIN_NO_EXPORT __attribute__ ((visibility("hidden")))
#define PLUGIN_EXPORT __attribute__ ((visibility("default")))
#elif defined(Q_WS_WIN)
#define PLUGIN_NO_EXPORT
#define PLUGIN_EXPORT __declspec(dllexport)
#else
#define PLUGIN_NO_EXPORT
#define PLUGIN_EXPORT
#endif
#endif /* _PLUGIN_EXPORTS_H_ */

@ -36,8 +36,9 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <sys/wait.h>
@ -69,6 +70,7 @@
#include "npapi.h"
#include "plugin.h"
#include "plugin-exports.h"
/* define LOG to write debug messages to /tmp/kaffeine_plugin.log */
@ -139,6 +141,7 @@ static void xprintf (const char *format, ...) {
#endif
}
PLUGIN_EXPORT
char *NPP_GetMIMEDescription(void) {
xprintf("NPP_GetMIMEDescription:\n");
@ -166,6 +169,7 @@ char *NPP_GetMIMEDescription(void) {
;
}
PLUGIN_EXPORT
NPError NPP_GetValue(void *future, NPPVariable variable, void *value){
NPError err = NPERR_NO_ERROR;
@ -185,6 +189,7 @@ NPError NPP_GetValue(void *future, NPPVariable variable, void *value){
return err;
}
PLUGIN_EXPORT
NPError NPP_Initialize(void) {
xprintf("NPP_Initialize:\n");
@ -200,11 +205,13 @@ NPError NPP_Initialize(void) {
}
PLUGIN_EXPORT
void * NPP_GetJavaClass() {
xprintf("NPP_GetJavaClass:\n");
return NULL;
}
PLUGIN_EXPORT
void NPP_Shutdown(void) {
xprintf("NPP_Shutdown:\n");
}
@ -317,6 +324,7 @@ static void got_url (const char *url_) {
}
PLUGIN_EXPORT
NPError NPP_New(NPMIMEType pluginType, NPP instance,
uint16 mode,
int16 argc, char* argn[], char* argv[],
@ -378,6 +386,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance,
}
PLUGIN_EXPORT
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
plugin_instance_t* this;
@ -438,6 +447,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow* window) {
return NPERR_NO_ERROR;
}
PLUGIN_EXPORT
NPError NPP_Destroy(NPP instance, NPSavedData** save) {
plugin_instance_t* this;
@ -463,6 +473,7 @@ NPError NPP_Destroy(NPP instance, NPSavedData** save) {
}
PLUGIN_EXPORT
NPError NPP_NewStream (NPP instance,
NPMIMEType type,
NPStream *stream,
@ -516,6 +527,7 @@ int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile
* mode so we can take any size stream in our
* write call (since we ignore it) */
PLUGIN_EXPORT
int32 NPP_WriteReady(NPP instance, NPStream *stream) {
plugin_instance_t* this;
@ -527,6 +539,7 @@ int32 NPP_WriteReady(NPP instance, NPStream *stream) {
}
PLUGIN_EXPORT
int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) {
xprintf("NPP_Write:\n");
@ -540,6 +553,7 @@ int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *b
}
PLUGIN_EXPORT
NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) {
plugin_instance_t* this;
@ -553,6 +567,7 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) {
}
PLUGIN_EXPORT
void NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) {
plugin_instance_t* this;
@ -563,6 +578,7 @@ void NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) {
}
PLUGIN_EXPORT
void NPP_Print(NPP instance, NPPrint* printInfo) {
xprintf("NPP_Print:\n");
@ -572,6 +588,7 @@ void NPP_Print(NPP instance, NPPrint* printInfo) {
xprintf("NPP_Print: Not implemented. \n");
}
PLUGIN_EXPORT
int16 NPP_HandleEvent(NPP instance, void* ev) {
xprintf("NPP_HandleEvent\n");

Loading…
Cancel
Save