|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NPFUNCTIONS_H |
|
20 #define NPFUNCTIONS_H |
|
21 |
|
22 #include <WebKit/npruntime.h> |
|
23 #include <WebKit/npapi.h> |
|
24 |
|
25 #if defined(XP_MACOSX) && defined(__LP64__) |
|
26 #error 64-bit Netscape plug-ins are not supported on Mac OS X |
|
27 #endif |
|
28 |
|
29 #ifdef __cplusplus |
|
30 extern "C" { |
|
31 #endif |
|
32 |
|
33 typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, void* notifyData); |
|
34 typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); |
|
35 typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList); |
|
36 typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); |
|
37 typedef int32 (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32 len, void* buffer); |
|
38 typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason); |
|
39 typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message); |
|
40 typedef const char*(*NPN_UserAgentProcPtr)(NPP instance); |
|
41 typedef void* (*NPN_MemAllocProcPtr)(uint32 size); |
|
42 typedef void (*NPN_MemFreeProcPtr)(void* ptr); |
|
43 typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size); |
|
44 typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages); |
|
45 typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value); |
|
46 typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value); |
|
47 typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect); |
|
48 typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region); |
|
49 typedef void (*NPN_ForceRedrawProcPtr)(NPP instance); |
|
50 typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* URL, const char* window); |
|
51 typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file); |
|
52 typedef void* (*NPN_GetJavaEnvProcPtr)(void); |
|
53 typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance); |
|
54 typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled); |
|
55 typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance); |
|
56 |
|
57 |
|
58 typedef void (*NPN_ReleaseVariantValueProcPtr) (NPVariant *variant); |
|
59 |
|
60 typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr) (const NPUTF8 *name); |
|
61 typedef void (*NPN_GetStringIdentifiersProcPtr) (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers); |
|
62 typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr) (int32_t intid); |
|
63 typedef int32_t (*NPN_IntFromIdentifierProcPtr) (NPIdentifier identifier); |
|
64 typedef bool (*NPN_IdentifierIsStringProcPtr) (NPIdentifier identifier); |
|
65 typedef NPUTF8 *(*NPN_UTF8FromIdentifierProcPtr) (NPIdentifier identifier); |
|
66 |
|
67 typedef NPObject* (*NPN_CreateObjectProcPtr) (NPP, NPClass *aClass); |
|
68 typedef NPObject* (*NPN_RetainObjectProcPtr) (NPObject *obj); |
|
69 typedef void (*NPN_ReleaseObjectProcPtr) (NPObject *obj); |
|
70 typedef bool (*NPN_InvokeProcPtr) (NPP npp, NPObject *obj, NPIdentifier methodName, const NPVariant *args, unsigned argCount, NPVariant *result); |
|
71 typedef bool (*NPN_InvokeDefaultProcPtr) (NPP npp, NPObject *obj, const NPVariant *args, unsigned argCount, NPVariant *result); |
|
72 typedef bool (*NPN_EvaluateProcPtr) (NPP npp, NPObject *obj, NPString *script, NPVariant *result); |
|
73 typedef bool (*NPN_GetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result); |
|
74 typedef bool (*NPN_SetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value); |
|
75 typedef bool (*NPN_HasPropertyProcPtr) (NPP, NPObject *npobj, NPIdentifier propertyName); |
|
76 typedef bool (*NPN_HasMethodProcPtr) (NPP npp, NPObject *npobj, NPIdentifier methodName); |
|
77 typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName); |
|
78 typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message); |
|
79 typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count); |
|
80 |
|
81 typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); |
|
82 typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save); |
|
83 typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window); |
|
84 typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); |
|
85 typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason); |
|
86 typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname); |
|
87 typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream); |
|
88 typedef int32 (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer); |
|
89 typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint); |
|
90 typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event); |
|
91 typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData); |
|
92 typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value); |
|
93 typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value); |
|
94 typedef void (*NPP_ShutdownProcPtr)(void); |
|
95 |
|
96 typedef void *(*NPP_GetJavaClassProcPtr)(void); |
|
97 typedef void* JRIGlobalRef; //not using this right now |
|
98 |
|
99 typedef struct _NPNetscapeFuncs { |
|
100 uint16 size; |
|
101 uint16 version; |
|
102 |
|
103 NPN_GetURLProcPtr geturl; |
|
104 NPN_PostURLProcPtr posturl; |
|
105 NPN_RequestReadProcPtr requestread; |
|
106 NPN_NewStreamProcPtr newstream; |
|
107 NPN_WriteProcPtr write; |
|
108 NPN_DestroyStreamProcPtr destroystream; |
|
109 NPN_StatusProcPtr status; |
|
110 NPN_UserAgentProcPtr uagent; |
|
111 NPN_MemAllocProcPtr memalloc; |
|
112 NPN_MemFreeProcPtr memfree; |
|
113 NPN_MemFlushProcPtr memflush; |
|
114 NPN_ReloadPluginsProcPtr reloadplugins; |
|
115 NPN_GetJavaEnvProcPtr getJavaEnv; |
|
116 NPN_GetJavaPeerProcPtr getJavaPeer; |
|
117 NPN_GetURLNotifyProcPtr geturlnotify; |
|
118 NPN_PostURLNotifyProcPtr posturlnotify; |
|
119 NPN_GetValueProcPtr getvalue; |
|
120 NPN_SetValueProcPtr setvalue; |
|
121 NPN_InvalidateRectProcPtr invalidaterect; |
|
122 NPN_InvalidateRegionProcPtr invalidateregion; |
|
123 NPN_ForceRedrawProcPtr forceredraw; |
|
124 |
|
125 NPN_GetStringIdentifierProcPtr getstringidentifier; |
|
126 NPN_GetStringIdentifiersProcPtr getstringidentifiers; |
|
127 NPN_GetIntIdentifierProcPtr getintidentifier; |
|
128 NPN_IdentifierIsStringProcPtr identifierisstring; |
|
129 NPN_UTF8FromIdentifierProcPtr utf8fromidentifier; |
|
130 NPN_IntFromIdentifierProcPtr intfromidentifier; |
|
131 NPN_CreateObjectProcPtr createobject; |
|
132 NPN_RetainObjectProcPtr retainobject; |
|
133 NPN_ReleaseObjectProcPtr releaseobject; |
|
134 NPN_InvokeProcPtr invoke; |
|
135 NPN_InvokeDefaultProcPtr invokeDefault; |
|
136 NPN_EvaluateProcPtr evaluate; |
|
137 NPN_GetPropertyProcPtr getproperty; |
|
138 NPN_SetPropertyProcPtr setproperty; |
|
139 NPN_RemovePropertyProcPtr removeproperty; |
|
140 NPN_HasPropertyProcPtr hasproperty; |
|
141 NPN_HasMethodProcPtr hasmethod; |
|
142 NPN_ReleaseVariantValueProcPtr releasevariantvalue; |
|
143 NPN_SetExceptionProcPtr setexception; |
|
144 NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate; |
|
145 NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate; |
|
146 NPN_EnumerateProcPtr enumerate; |
|
147 } NPNetscapeFuncs; |
|
148 |
|
149 typedef struct _NPPluginFuncs { |
|
150 uint16 size; |
|
151 uint16 version; |
|
152 NPP_NewProcPtr newp; |
|
153 NPP_DestroyProcPtr destroy; |
|
154 NPP_SetWindowProcPtr setwindow; |
|
155 NPP_NewStreamProcPtr newstream; |
|
156 NPP_DestroyStreamProcPtr destroystream; |
|
157 NPP_StreamAsFileProcPtr asfile; |
|
158 NPP_WriteReadyProcPtr writeready; |
|
159 NPP_WriteProcPtr write; |
|
160 NPP_PrintProcPtr print; |
|
161 NPP_HandleEventProcPtr event; |
|
162 NPP_URLNotifyProcPtr urlnotify; |
|
163 JRIGlobalRef javaClass; |
|
164 NPP_GetValueProcPtr getvalue; |
|
165 NPP_SetValueProcPtr setvalue; |
|
166 } NPPluginFuncs; |
|
167 |
|
168 #if defined(XP_MACOSX) |
|
169 typedef NPError (*NP_InitializeFuncPtr)(NPNetscapeFuncs*); |
|
170 typedef NPError (*NP_GetEntryPointsFuncPtr)(NPPluginFuncs*); |
|
171 typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); |
|
172 typedef NPError (*MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*); |
|
173 #endif |
|
174 |
|
175 #ifdef __cplusplus |
|
176 } |
|
177 #endif |
|
178 |
|
179 #endif |