0
|
1 |
/*
|
|
2 |
* Copyright (C) 2007 Apple Inc. All rights reserved.
|
|
3 |
*
|
|
4 |
* Redistribution and use in source and binary forms, with or without
|
|
5 |
* modification, are permitted provided that the following conditions
|
|
6 |
* are met:
|
|
7 |
* 1. Redistributions of source code must retain the above copyright
|
|
8 |
* notice, this list of conditions and the following disclaimer.
|
|
9 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
10 |
* notice, this list of conditions and the following disclaimer in the
|
|
11 |
* documentation and/or other materials provided with the distribution.
|
|
12 |
*
|
|
13 |
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
|
14 |
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
16 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
|
17 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
18 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
19 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
20 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
21 |
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
23 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24 |
*/
|
|
25 |
#ifndef NPFUNCTIONS_H
|
|
26 |
#define NPFUNCTIONS_H
|
|
27 |
|
|
28 |
|
|
29 |
#include "npruntime.h"
|
|
30 |
#include "npapi.h"
|
|
31 |
|
|
32 |
#ifdef __cplusplus
|
|
33 |
extern "C" {
|
|
34 |
#endif
|
|
35 |
|
|
36 |
#if defined(XP_WIN)
|
|
37 |
#define EXPORTED_CALLBACK(_type, _name) _type (__stdcall * _name)
|
|
38 |
#else
|
|
39 |
#define EXPORTED_CALLBACK(_type, _name) _type (* _name)
|
|
40 |
#endif
|
|
41 |
|
|
42 |
typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, void* notifyData);
|
|
43 |
typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
|
|
44 |
typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
|
|
45 |
typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
|
|
46 |
typedef int32 (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32 len, void* buffer);
|
|
47 |
typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
|
|
48 |
typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
|
|
49 |
typedef const char*(*NPN_UserAgentProcPtr)(NPP instance);
|
|
50 |
typedef void* (*NPN_MemAllocProcPtr)(uint32 size);
|
|
51 |
typedef void (*NPN_MemFreeProcPtr)(void* ptr);
|
|
52 |
typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size);
|
|
53 |
typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
|
|
54 |
typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
|
|
55 |
typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
|
|
56 |
typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
|
|
57 |
typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
|
|
58 |
typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
|
|
59 |
typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* URL, const char* window);
|
|
60 |
typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file);
|
|
61 |
typedef void* (*NPN_GetJavaEnvProcPtr)(void);
|
|
62 |
typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
|
|
63 |
typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled);
|
|
64 |
typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance);
|
|
65 |
typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP npp, void (*func)(void *), void *userData);
|
|
66 |
typedef NPError (*NPN_GetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, char** value, uint32* len);
|
|
67 |
typedef NPError (*NPN_SetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, const char* value, uint32 len);
|
|
68 |
typedef NPError (*NPN_GetAuthenticationInfoProcPtr)(NPP npp, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen);
|
|
69 |
|
|
70 |
typedef uint32 (*NPN_ScheduleTimerProcPtr)(NPP npp, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID));
|
|
71 |
typedef void (*NPN_UnscheduleTimerProcPtr)(NPP npp, uint32 timerID);
|
|
72 |
typedef NPError (*NPN_PopUpContextMenuProcPtr)(NPP instance, NPMenu* menu);
|
|
73 |
typedef NPBool (*NPN_ConvertPointProcPtr)(NPP npp, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
|
|
74 |
|
|
75 |
typedef void (*NPN_ReleaseVariantValueProcPtr) (NPVariant *variant);
|
|
76 |
|
|
77 |
typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr) (const NPUTF8 *name);
|
|
78 |
typedef void (*NPN_GetStringIdentifiersProcPtr) (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers);
|
|
79 |
typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr) (int32_t intid);
|
|
80 |
typedef int32_t (*NPN_IntFromIdentifierProcPtr) (NPIdentifier identifier);
|
|
81 |
typedef bool (*NPN_IdentifierIsStringProcPtr) (NPIdentifier identifier);
|
|
82 |
typedef NPUTF8 *(*NPN_UTF8FromIdentifierProcPtr) (NPIdentifier identifier);
|
|
83 |
|
|
84 |
typedef NPObject* (*NPN_CreateObjectProcPtr) (NPP, NPClass *aClass);
|
|
85 |
typedef NPObject* (*NPN_RetainObjectProcPtr) (NPObject *obj);
|
|
86 |
typedef void (*NPN_ReleaseObjectProcPtr) (NPObject *obj);
|
|
87 |
typedef bool (*NPN_InvokeProcPtr) (NPP npp, NPObject *obj, NPIdentifier methodName, const NPVariant *args, unsigned argCount, NPVariant *result);
|
|
88 |
typedef bool (*NPN_InvokeDefaultProcPtr) (NPP npp, NPObject *obj, const NPVariant *args, unsigned argCount, NPVariant *result);
|
|
89 |
typedef bool (*NPN_EvaluateProcPtr) (NPP npp, NPObject *obj, NPString *script, NPVariant *result);
|
|
90 |
typedef bool (*NPN_GetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
|
|
91 |
typedef bool (*NPN_SetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
|
|
92 |
typedef bool (*NPN_HasPropertyProcPtr) (NPP, NPObject *npobj, NPIdentifier propertyName);
|
|
93 |
typedef bool (*NPN_HasMethodProcPtr) (NPP npp, NPObject *npobj, NPIdentifier methodName);
|
|
94 |
typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName);
|
|
95 |
typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message);
|
|
96 |
typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count);
|
|
97 |
typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
|
|
98 |
|
|
99 |
typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
|
|
100 |
typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
|
|
101 |
typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
|
|
102 |
typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
|
|
103 |
typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
|
|
104 |
typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
|
|
105 |
typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
|
|
106 |
typedef int32 (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
|
|
107 |
typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
|
|
108 |
typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event);
|
|
109 |
typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData);
|
|
110 |
typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
|
|
111 |
typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
|
|
112 |
|
|
113 |
typedef void *(*NPP_GetJavaClassProcPtr)(void);
|
|
114 |
typedef void* JRIGlobalRef; //not using this right now
|
|
115 |
|
|
116 |
typedef struct _NPNetscapeFuncs {
|
|
117 |
uint16 size;
|
|
118 |
uint16 version;
|
|
119 |
|
|
120 |
NPN_GetURLProcPtr geturl;
|
|
121 |
NPN_PostURLProcPtr posturl;
|
|
122 |
NPN_RequestReadProcPtr requestread;
|
|
123 |
NPN_NewStreamProcPtr newstream;
|
|
124 |
NPN_WriteProcPtr write;
|
|
125 |
NPN_DestroyStreamProcPtr destroystream;
|
|
126 |
NPN_StatusProcPtr status;
|
|
127 |
NPN_UserAgentProcPtr uagent;
|
|
128 |
NPN_MemAllocProcPtr memalloc;
|
|
129 |
NPN_MemFreeProcPtr memfree;
|
|
130 |
NPN_MemFlushProcPtr memflush;
|
|
131 |
NPN_ReloadPluginsProcPtr reloadplugins;
|
|
132 |
NPN_GetJavaEnvProcPtr getJavaEnv;
|
|
133 |
NPN_GetJavaPeerProcPtr getJavaPeer;
|
|
134 |
NPN_GetURLNotifyProcPtr geturlnotify;
|
|
135 |
NPN_PostURLNotifyProcPtr posturlnotify;
|
|
136 |
NPN_GetValueProcPtr getvalue;
|
|
137 |
NPN_SetValueProcPtr setvalue;
|
|
138 |
NPN_InvalidateRectProcPtr invalidaterect;
|
|
139 |
NPN_InvalidateRegionProcPtr invalidateregion;
|
|
140 |
NPN_ForceRedrawProcPtr forceredraw;
|
|
141 |
|
|
142 |
NPN_GetStringIdentifierProcPtr getstringidentifier;
|
|
143 |
NPN_GetStringIdentifiersProcPtr getstringidentifiers;
|
|
144 |
NPN_GetIntIdentifierProcPtr getintidentifier;
|
|
145 |
NPN_IdentifierIsStringProcPtr identifierisstring;
|
|
146 |
NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
|
|
147 |
NPN_IntFromIdentifierProcPtr intfromidentifier;
|
|
148 |
NPN_CreateObjectProcPtr createobject;
|
|
149 |
NPN_RetainObjectProcPtr retainobject;
|
|
150 |
NPN_ReleaseObjectProcPtr releaseobject;
|
|
151 |
NPN_InvokeProcPtr invoke;
|
|
152 |
NPN_InvokeDefaultProcPtr invokeDefault;
|
|
153 |
NPN_EvaluateProcPtr evaluate;
|
|
154 |
NPN_GetPropertyProcPtr getproperty;
|
|
155 |
NPN_SetPropertyProcPtr setproperty;
|
|
156 |
NPN_RemovePropertyProcPtr removeproperty;
|
|
157 |
NPN_HasPropertyProcPtr hasproperty;
|
|
158 |
NPN_HasMethodProcPtr hasmethod;
|
|
159 |
NPN_ReleaseVariantValueProcPtr releasevariantvalue;
|
|
160 |
NPN_SetExceptionProcPtr setexception;
|
|
161 |
NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
|
|
162 |
NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
|
|
163 |
NPN_EnumerateProcPtr enumerate;
|
|
164 |
NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
|
|
165 |
NPN_ConstructProcPtr construct;
|
|
166 |
NPN_GetValueForURLProcPtr getvalueforurl;
|
|
167 |
NPN_SetValueForURLProcPtr setvalueforurl;
|
|
168 |
NPN_GetAuthenticationInfoProcPtr getauthenticationinfo;
|
|
169 |
NPN_ScheduleTimerProcPtr scheduletimer;
|
|
170 |
NPN_UnscheduleTimerProcPtr unscheduletimer;
|
|
171 |
NPN_PopUpContextMenuProcPtr popupcontextmenu;
|
|
172 |
NPN_ConvertPointProcPtr convertpoint;
|
|
173 |
} NPNetscapeFuncs;
|
|
174 |
|
|
175 |
typedef struct _NPPluginFuncs {
|
|
176 |
uint16 size;
|
|
177 |
uint16 version;
|
|
178 |
NPP_NewProcPtr newp;
|
|
179 |
NPP_DestroyProcPtr destroy;
|
|
180 |
NPP_SetWindowProcPtr setwindow;
|
|
181 |
NPP_NewStreamProcPtr newstream;
|
|
182 |
NPP_DestroyStreamProcPtr destroystream;
|
|
183 |
NPP_StreamAsFileProcPtr asfile;
|
|
184 |
NPP_WriteReadyProcPtr writeready;
|
|
185 |
NPP_WriteProcPtr write;
|
|
186 |
NPP_PrintProcPtr print;
|
|
187 |
NPP_HandleEventProcPtr event;
|
|
188 |
NPP_URLNotifyProcPtr urlnotify;
|
|
189 |
JRIGlobalRef javaClass;
|
|
190 |
NPP_GetValueProcPtr getvalue;
|
|
191 |
NPP_SetValueProcPtr setvalue;
|
|
192 |
} NPPluginFuncs;
|
|
193 |
|
|
194 |
typedef EXPORTED_CALLBACK(NPError, NP_GetEntryPointsFuncPtr)(NPPluginFuncs*);
|
|
195 |
typedef EXPORTED_CALLBACK(void, NPP_ShutdownProcPtr)(void);
|
|
196 |
|
|
197 |
#if defined(XP_MACOSX)
|
|
198 |
typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
|
|
199 |
typedef NPError (*MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
|
|
200 |
#endif
|
|
201 |
|
|
202 |
#if defined(XP_UNIX)
|
|
203 |
typedef EXPORTED_CALLBACK(NPError, NP_InitializeFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*);
|
|
204 |
typedef EXPORTED_CALLBACK(char*, NP_GetMIMEDescriptionFuncPtr)(void);
|
|
205 |
#else
|
|
206 |
typedef EXPORTED_CALLBACK(NPError, NP_InitializeFuncPtr)(NPNetscapeFuncs*);
|
|
207 |
#endif
|
|
208 |
|
|
209 |
#ifdef __cplusplus
|
|
210 |
}
|
|
211 |
#endif
|
|
212 |
|
|
213 |
#endif
|