Lines 1-21
Link Here
|
1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 |
* |
2 |
* |
3 |
* Mozilla/Firefox plugin for VLC |
3 |
* ***** BEGIN LICENSE BLOCK ***** |
4 |
* Copyright (C) 2009, Jean-Paul Saman <jpsaman@videolan.org> |
4 |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
5 |
* |
5 |
* |
6 |
* This library is free software; you can redistribute it and/or |
6 |
* The contents of this file are subject to the Mozilla Public License Version |
7 |
* modify it under the terms of the GNU Lesser General Public |
7 |
* 1.1 (the "License"); you may not use this file except in compliance with |
8 |
* License as published by the Free Software Foundation; either |
8 |
* the License. You may obtain a copy of the License at |
9 |
* version 2.1 of the License, or (at your option) any later version. |
9 |
* http://www.mozilla.org/MPL/ |
10 |
* |
10 |
* |
11 |
* This library is distributed in the hope that it will be useful, |
11 |
* Software distributed under the License is distributed on an "AS IS" basis, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 |
* for the specific language governing rights and limitations under the |
14 |
* Lesser General Public License for more details. |
14 |
* License. |
15 |
* |
|
|
16 |
* You should have received a copy of the GNU Lesser General Public |
17 |
* License along with this library; if not, write to the Free Software |
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 |
* |
15 |
* |
20 |
* The Original Code is mozilla.org code. |
16 |
* The Original Code is mozilla.org code. |
21 |
* |
17 |
* |
Lines 27-33
Link Here
|
27 |
* Contributor(s): |
23 |
* Contributor(s): |
28 |
* Stephen Mak <smak@sun.com> |
24 |
* Stephen Mak <smak@sun.com> |
29 |
* |
25 |
* |
30 |
*/ |
26 |
* Alternatively, the contents of this file may be used under the terms of |
|
|
27 |
* either of the GNU General Public License Version 2 or later (the "GPL"), |
28 |
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
29 |
* in which case the provisions of the GPL or the LGPL are applicable instead |
30 |
* of those above. If you wish to allow use of your version of this file only |
31 |
* under the terms of either the GPL or the LGPL, and not to allow others to |
32 |
* use your version of this file under the terms of the MPL, indicate your |
33 |
* decision by deleting the provisions above and replace them with the notice |
34 |
* and other provisions required by the GPL or the LGPL. If you do not delete |
35 |
* the provisions above, a recipient may use your version of this file under |
36 |
* the terms of any one of the MPL, the GPL or the LGPL. |
37 |
* |
38 |
* ***** END LICENSE BLOCK ***** */ |
31 |
|
39 |
|
32 |
/* |
40 |
/* |
33 |
* npunix.c |
41 |
* npunix.c |
Lines 43-61
Link Here
|
43 |
*---------------------------------------------------------------------- |
51 |
*---------------------------------------------------------------------- |
44 |
*/ |
52 |
*/ |
45 |
|
53 |
|
46 |
#include "config.h" |
|
|
47 |
|
48 |
#define XP_UNIX 1 |
54 |
#define XP_UNIX 1 |
49 |
#define OJI 1 |
|
|
50 |
|
51 |
#include <npapi.h> |
52 |
#ifdef HAVE_NPFUNCTIONS_H |
53 |
#include <npfunctions.h> |
54 |
#else |
55 |
#include <npupp.h> |
56 |
#endif |
57 |
|
55 |
|
58 |
#include "../vlcshell.h" |
56 |
#include <stdio.h> |
|
|
57 |
#include "npapi.h" |
58 |
#include "npfunctions.h" |
59 |
|
59 |
|
60 |
/* |
60 |
/* |
61 |
* Define PLUGIN_TRACE to have the wrapper functions print |
61 |
* Define PLUGIN_TRACE to have the wrapper functions print |
Lines 69-74
Link Here
|
69 |
#define PLUGINDEBUGSTR(msg) |
69 |
#define PLUGINDEBUGSTR(msg) |
70 |
#endif |
70 |
#endif |
71 |
|
71 |
|
|
|
72 |
|
72 |
/*********************************************************************** |
73 |
/*********************************************************************** |
73 |
* |
74 |
* |
74 |
* Globals |
75 |
* Globals |
Lines 77-82
Link Here
|
77 |
|
78 |
|
78 |
static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */ |
79 |
static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */ |
79 |
|
80 |
|
|
|
81 |
|
80 |
/*********************************************************************** |
82 |
/*********************************************************************** |
81 |
* |
83 |
* |
82 |
* Wrapper functions : plugin calling Netscape Navigator |
84 |
* Wrapper functions : plugin calling Netscape Navigator |
Lines 103-604
NPN_Version(int* plugin_major, int* plug
Link Here
|
103 |
NPError |
105 |
NPError |
104 |
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value) |
106 |
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value) |
105 |
{ |
107 |
{ |
106 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
107 |
return CallNPN_GetValueProc(gNetscapeFuncs.getvalue, |
108 |
instance, variable, r_value); |
109 |
#else |
110 |
return (*gNetscapeFuncs.getvalue)(instance, variable, r_value); |
108 |
return (*gNetscapeFuncs.getvalue)(instance, variable, r_value); |
111 |
#endif |
|
|
112 |
} |
109 |
} |
113 |
|
110 |
|
114 |
NPError |
111 |
NPError |
115 |
NPN_SetValue(NPP instance, NPPVariable variable, void *value) |
112 |
NPN_SetValue(NPP instance, NPPVariable variable, void *value) |
116 |
{ |
113 |
{ |
117 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
118 |
return CallNPN_SetValueProc(gNetscapeFuncs.setvalue, |
119 |
instance, variable, value); |
120 |
#else |
121 |
return (*gNetscapeFuncs.setvalue)(instance, variable, value); |
114 |
return (*gNetscapeFuncs.setvalue)(instance, variable, value); |
122 |
#endif |
|
|
123 |
} |
115 |
} |
124 |
|
116 |
|
125 |
NPError |
117 |
NPError |
126 |
NPN_GetURL(NPP instance, const char* url, const char* window) |
118 |
NPN_GetURL(NPP instance, const char* url, const char* window) |
127 |
{ |
119 |
{ |
128 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
129 |
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); |
130 |
#else |
131 |
return (*gNetscapeFuncs.geturl)(instance, url, window); |
120 |
return (*gNetscapeFuncs.geturl)(instance, url, window); |
132 |
#endif |
|
|
133 |
} |
121 |
} |
134 |
|
122 |
|
135 |
NPError |
123 |
NPError |
136 |
NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData) |
124 |
NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData) |
137 |
{ |
125 |
{ |
138 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
139 |
return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData); |
140 |
#else |
141 |
return (*gNetscapeFuncs.geturlnotify)(instance, url, window, notifyData); |
126 |
return (*gNetscapeFuncs.geturlnotify)(instance, url, window, notifyData); |
142 |
#endif |
|
|
143 |
} |
127 |
} |
144 |
|
128 |
|
145 |
NPError |
129 |
NPError |
146 |
NPN_PostURL(NPP instance, const char* url, const char* window, |
130 |
NPN_PostURL(NPP instance, const char* url, const char* window, |
147 |
uint32_t len, const char* buf, NPBool file) |
131 |
uint32_t len, const char* buf, NPBool file) |
148 |
{ |
132 |
{ |
149 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
150 |
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, |
151 |
url, window, len, buf, file); |
152 |
#else |
153 |
return (*gNetscapeFuncs.posturl)(instance, url, window, len, buf, file); |
133 |
return (*gNetscapeFuncs.posturl)(instance, url, window, len, buf, file); |
154 |
#endif |
|
|
155 |
} |
134 |
} |
156 |
|
135 |
|
157 |
NPError |
136 |
NPError |
158 |
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, |
137 |
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, |
159 |
const char* buf, NPBool file, void* notifyData) |
138 |
const char* buf, NPBool file, void* notifyData) |
160 |
{ |
139 |
{ |
161 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
162 |
return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, |
163 |
instance, url, window, len, buf, file, notifyData); |
164 |
#else |
165 |
return (*gNetscapeFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData); |
140 |
return (*gNetscapeFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData); |
166 |
|
|
|
167 |
#endif |
168 |
} |
141 |
} |
169 |
|
142 |
|
170 |
NPError |
143 |
NPError |
171 |
NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) |
144 |
NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) |
172 |
{ |
145 |
{ |
173 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
174 |
return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, |
175 |
stream, rangeList); |
176 |
#else |
177 |
return (*gNetscapeFuncs.requestread)(stream, rangeList); |
146 |
return (*gNetscapeFuncs.requestread)(stream, rangeList); |
178 |
#endif |
|
|
179 |
} |
147 |
} |
180 |
|
148 |
|
181 |
NPError |
149 |
NPError |
182 |
NPN_NewStream(NPP instance, NPMIMEType type, const char *window, |
150 |
NPN_NewStream(NPP instance, NPMIMEType type, const char *window, |
183 |
NPStream** stream_ptr) |
151 |
NPStream** stream_ptr) |
184 |
{ |
152 |
{ |
185 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
186 |
return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, |
187 |
type, window, stream_ptr); |
188 |
#else |
189 |
return (*gNetscapeFuncs.newstream)(instance, type, window, stream_ptr); |
153 |
return (*gNetscapeFuncs.newstream)(instance, type, window, stream_ptr); |
190 |
#endif |
|
|
191 |
} |
154 |
} |
192 |
|
155 |
|
193 |
int32_t |
156 |
int32_t |
194 |
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer) |
157 |
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer) |
195 |
{ |
158 |
{ |
196 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
197 |
return CallNPN_WriteProc(gNetscapeFuncs.write, instance, |
198 |
stream, len, buffer); |
199 |
#else |
200 |
return (*gNetscapeFuncs.write)(instance, stream, len, buffer); |
159 |
return (*gNetscapeFuncs.write)(instance, stream, len, buffer); |
201 |
#endif |
|
|
202 |
} |
160 |
} |
203 |
|
161 |
|
204 |
NPError |
162 |
NPError |
205 |
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) |
163 |
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) |
206 |
{ |
164 |
{ |
207 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
208 |
return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, |
209 |
instance, stream, reason); |
210 |
#else |
211 |
return (*gNetscapeFuncs.destroystream)(instance, stream, reason); |
165 |
return (*gNetscapeFuncs.destroystream)(instance, stream, reason); |
212 |
#endif |
|
|
213 |
} |
166 |
} |
214 |
|
167 |
|
215 |
void |
168 |
void |
216 |
NPN_Status(NPP instance, const char* message) |
169 |
NPN_Status(NPP instance, const char* message) |
217 |
{ |
170 |
{ |
218 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
219 |
CallNPN_StatusProc(gNetscapeFuncs.status, instance, message); |
220 |
#else |
221 |
(*gNetscapeFuncs.status)(instance, message); |
171 |
(*gNetscapeFuncs.status)(instance, message); |
222 |
#endif |
|
|
223 |
} |
172 |
} |
224 |
|
173 |
|
225 |
const char* |
174 |
const char* |
226 |
NPN_UserAgent(NPP instance) |
175 |
NPN_UserAgent(NPP instance) |
227 |
{ |
176 |
{ |
228 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
229 |
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); |
230 |
#else |
231 |
return (*gNetscapeFuncs.uagent)(instance); |
177 |
return (*gNetscapeFuncs.uagent)(instance); |
232 |
#endif |
|
|
233 |
} |
178 |
} |
234 |
|
179 |
|
235 |
void *NPN_MemAlloc(uint32_t size) |
180 |
void* |
|
|
181 |
NPN_MemAlloc(uint32_t size) |
236 |
{ |
182 |
{ |
237 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
238 |
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); |
239 |
#else |
240 |
return (*gNetscapeFuncs.memalloc)(size); |
183 |
return (*gNetscapeFuncs.memalloc)(size); |
241 |
#endif |
|
|
242 |
} |
184 |
} |
243 |
|
185 |
|
244 |
void NPN_MemFree(void* ptr) |
186 |
void NPN_MemFree(void* ptr) |
245 |
{ |
187 |
{ |
246 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
247 |
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); |
248 |
#else |
249 |
(*gNetscapeFuncs.memfree)(ptr); |
188 |
(*gNetscapeFuncs.memfree)(ptr); |
250 |
#endif |
|
|
251 |
} |
189 |
} |
252 |
|
190 |
|
253 |
uint32_t NPN_MemFlush(uint32_t size) |
191 |
uint32_t NPN_MemFlush(uint32_t size) |
254 |
{ |
192 |
{ |
255 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
256 |
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); |
257 |
#else |
258 |
return (*gNetscapeFuncs.memflush)(size); |
193 |
return (*gNetscapeFuncs.memflush)(size); |
259 |
#endif |
|
|
260 |
} |
194 |
} |
261 |
|
195 |
|
262 |
void NPN_ReloadPlugins(NPBool reloadPages) |
196 |
void NPN_ReloadPlugins(NPBool reloadPages) |
263 |
{ |
197 |
{ |
264 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
265 |
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); |
266 |
#else |
267 |
(*gNetscapeFuncs.reloadplugins)(reloadPages); |
198 |
(*gNetscapeFuncs.reloadplugins)(reloadPages); |
268 |
#endif |
|
|
269 |
} |
270 |
|
271 |
#ifdef OJI |
272 |
JRIEnv* NPN_GetJavaEnv() |
273 |
{ |
274 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
275 |
return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv); |
276 |
#else |
277 |
return (*gNetscapeFuncs.getJavaEnv); |
278 |
#endif |
279 |
} |
199 |
} |
280 |
|
200 |
|
281 |
jref NPN_GetJavaPeer(NPP instance) |
|
|
282 |
{ |
283 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
284 |
return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer, |
285 |
instance); |
286 |
#else |
287 |
return (*gNetscapeFuncs.getJavaPeer)(instance); |
288 |
#endif |
289 |
} |
290 |
#endif |
291 |
|
292 |
void |
201 |
void |
293 |
NPN_InvalidateRect(NPP instance, NPRect *invalidRect) |
202 |
NPN_InvalidateRect(NPP instance, NPRect *invalidRect) |
294 |
{ |
203 |
{ |
295 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
296 |
CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance, |
297 |
invalidRect); |
298 |
#else |
299 |
(*gNetscapeFuncs.invalidaterect)(instance, invalidRect); |
204 |
(*gNetscapeFuncs.invalidaterect)(instance, invalidRect); |
300 |
#endif |
|
|
301 |
} |
205 |
} |
302 |
|
206 |
|
303 |
void |
207 |
void |
304 |
NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) |
208 |
NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) |
305 |
{ |
209 |
{ |
306 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
307 |
CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance, |
308 |
invalidRegion); |
309 |
#else |
310 |
(*gNetscapeFuncs.invalidateregion)(instance, invalidRegion); |
210 |
(*gNetscapeFuncs.invalidateregion)(instance, invalidRegion); |
311 |
#endif |
|
|
312 |
} |
211 |
} |
313 |
|
212 |
|
314 |
void |
213 |
void |
315 |
NPN_ForceRedraw(NPP instance) |
214 |
NPN_ForceRedraw(NPP instance) |
316 |
{ |
215 |
{ |
317 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
318 |
CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance); |
319 |
#else |
320 |
(*gNetscapeFuncs.forceredraw)(instance); |
216 |
(*gNetscapeFuncs.forceredraw)(instance); |
321 |
#endif |
|
|
322 |
} |
217 |
} |
323 |
|
218 |
|
324 |
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) |
219 |
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) |
325 |
{ |
220 |
{ |
326 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
327 |
CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate, |
328 |
instance, enabled); |
329 |
#else |
330 |
(*gNetscapeFuncs.pushpopupsenabledstate)(instance, enabled); |
221 |
(*gNetscapeFuncs.pushpopupsenabledstate)(instance, enabled); |
331 |
#endif |
|
|
332 |
} |
222 |
} |
333 |
|
223 |
|
334 |
void NPN_PopPopupsEnabledState(NPP instance) |
224 |
void NPN_PopPopupsEnabledState(NPP instance) |
335 |
{ |
225 |
{ |
336 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
337 |
CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs.poppopupsenabledstate, |
338 |
instance); |
339 |
#else |
340 |
(*gNetscapeFuncs.poppopupsenabledstate)(instance); |
226 |
(*gNetscapeFuncs.poppopupsenabledstate)(instance); |
341 |
#endif |
|
|
342 |
} |
227 |
} |
343 |
|
228 |
|
344 |
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) |
229 |
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) |
345 |
{ |
230 |
{ |
346 |
int minor = gNetscapeFuncs.version & 0xFF; |
231 |
return (*gNetscapeFuncs.getstringidentifier)(name); |
347 |
if( minor >= 14 ) |
|
|
348 |
{ |
349 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
350 |
return CallNPN_GetStringIdentifierProc( |
351 |
gNetscapeFuncs.getstringidentifier, name); |
352 |
#else |
353 |
return (*gNetscapeFuncs.getstringidentifier)(name); |
354 |
#endif |
355 |
} |
356 |
return NULL; |
357 |
} |
232 |
} |
358 |
|
233 |
|
359 |
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, |
234 |
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, |
360 |
NPIdentifier *identifiers) |
235 |
NPIdentifier *identifiers) |
361 |
{ |
236 |
{ |
362 |
int minor = gNetscapeFuncs.version & 0xFF; |
237 |
(*gNetscapeFuncs.getstringidentifiers)(names, nameCount, identifiers); |
363 |
if( minor >= 14 ) |
|
|
364 |
{ |
365 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
366 |
CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers, |
367 |
names, nameCount, identifiers); |
368 |
#else |
369 |
(*gNetscapeFuncs.getstringidentifiers)(names, nameCount, identifiers); |
370 |
#endif |
371 |
} |
372 |
} |
238 |
} |
373 |
|
239 |
|
374 |
NPIdentifier NPN_GetIntIdentifier(int32_t intid) |
240 |
NPIdentifier NPN_GetIntIdentifier(int32_t intid) |
375 |
{ |
241 |
{ |
376 |
int minor = gNetscapeFuncs.version & 0xFF; |
242 |
return (*gNetscapeFuncs.getintidentifier)(intid); |
377 |
if( minor >= 14 ) |
|
|
378 |
{ |
379 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
380 |
return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid); |
381 |
#else |
382 |
return (*gNetscapeFuncs.getintidentifier)(intid); |
383 |
#endif |
384 |
} |
385 |
return NULL; |
386 |
} |
243 |
} |
387 |
|
244 |
|
388 |
bool NPN_IdentifierIsString(NPIdentifier identifier) |
245 |
bool NPN_IdentifierIsString(NPIdentifier identifier) |
389 |
{ |
246 |
{ |
390 |
int minor = gNetscapeFuncs.version & 0xFF; |
247 |
return (*gNetscapeFuncs.identifierisstring)(identifier); |
391 |
if( minor >= 14 ) |
|
|
392 |
{ |
393 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
394 |
return CallNPN_IdentifierIsStringProc( |
395 |
gNetscapeFuncs.identifierisstring, |
396 |
identifier); |
397 |
#else |
398 |
return (*gNetscapeFuncs.identifierisstring)(identifier); |
399 |
#endif |
400 |
} |
401 |
return false; |
402 |
} |
248 |
} |
403 |
|
249 |
|
404 |
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) |
250 |
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) |
405 |
{ |
251 |
{ |
406 |
int minor = gNetscapeFuncs.version & 0xFF; |
252 |
return (*gNetscapeFuncs.utf8fromidentifier)(identifier); |
407 |
if( minor >= 14 ) |
|
|
408 |
{ |
409 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
410 |
return CallNPN_UTF8FromIdentifierProc( |
411 |
gNetscapeFuncs.utf8fromidentifier, |
412 |
identifier); |
413 |
#else |
414 |
return (*gNetscapeFuncs.utf8fromidentifier)(identifier); |
415 |
#endif |
416 |
} |
417 |
return NULL; |
418 |
} |
253 |
} |
419 |
|
254 |
|
420 |
int32_t NPN_IntFromIdentifier(NPIdentifier identifier) |
255 |
int32_t NPN_IntFromIdentifier(NPIdentifier identifier) |
421 |
{ |
256 |
{ |
422 |
int minor = gNetscapeFuncs.version & 0xFF; |
257 |
return (*gNetscapeFuncs.intfromidentifier)(identifier); |
423 |
if( minor >= 14 ) |
|
|
424 |
{ |
425 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
426 |
return CallNPN_IntFromIdentifierProc( |
427 |
gNetscapeFuncs.intfromidentifier, |
428 |
identifier); |
429 |
#else |
430 |
return (*gNetscapeFuncs.intfromidentifier)(identifier); |
431 |
#endif |
432 |
} |
433 |
return 0; |
434 |
} |
258 |
} |
435 |
|
259 |
|
436 |
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) |
260 |
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) |
437 |
{ |
261 |
{ |
438 |
int minor = gNetscapeFuncs.version & 0xFF; |
262 |
return (*gNetscapeFuncs.createobject)(npp, aClass); |
439 |
if( minor >= 14 ) |
|
|
440 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
441 |
return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass); |
442 |
#else |
443 |
return (*gNetscapeFuncs.createobject)(npp, aClass); |
444 |
#endif |
445 |
return NULL; |
446 |
} |
263 |
} |
447 |
|
264 |
|
448 |
NPObject *NPN_RetainObject(NPObject *obj) |
265 |
NPObject *NPN_RetainObject(NPObject *obj) |
449 |
{ |
266 |
{ |
450 |
int minor = gNetscapeFuncs.version & 0xFF; |
267 |
return (*gNetscapeFuncs.retainobject)(obj); |
451 |
if( minor >= 14 ) |
|
|
452 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
453 |
return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj); |
454 |
#else |
455 |
return (*gNetscapeFuncs.retainobject)(obj); |
456 |
#endif |
457 |
return NULL; |
458 |
} |
268 |
} |
459 |
|
269 |
|
460 |
void NPN_ReleaseObject(NPObject *obj) |
270 |
void NPN_ReleaseObject(NPObject *obj) |
461 |
{ |
271 |
{ |
462 |
int minor = gNetscapeFuncs.version & 0xFF; |
272 |
(*gNetscapeFuncs.releaseobject)(obj); |
463 |
if( minor >= 14 ) |
|
|
464 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
465 |
CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj); |
466 |
#else |
467 |
(*gNetscapeFuncs.releaseobject)(obj); |
468 |
#endif |
469 |
} |
273 |
} |
470 |
|
274 |
|
471 |
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, |
275 |
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, |
472 |
const NPVariant *args, uint32_t argCount, NPVariant *result) |
276 |
const NPVariant *args, uint32_t argCount, NPVariant *result) |
473 |
{ |
277 |
{ |
474 |
int minor = gNetscapeFuncs.version & 0xFF; |
278 |
return (*gNetscapeFuncs.invoke)(npp, obj, methodName, args, argCount, result); |
475 |
if( minor >= 14 ) |
|
|
476 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
477 |
return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName, |
478 |
args, argCount, result); |
479 |
#else |
480 |
return (*gNetscapeFuncs.invoke)(npp, obj, methodName, args, argCount, result); |
481 |
#endif |
482 |
return false; |
483 |
} |
279 |
} |
484 |
|
280 |
|
485 |
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args, |
281 |
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args, |
486 |
uint32_t argCount, NPVariant *result) |
282 |
uint32_t argCount, NPVariant *result) |
487 |
{ |
283 |
{ |
488 |
int minor = gNetscapeFuncs.version & 0xFF; |
284 |
return (*gNetscapeFuncs.invokeDefault)(npp, obj, args, argCount, result); |
489 |
if( minor >= 14 ) |
|
|
490 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
491 |
return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj, |
492 |
args, argCount, result); |
493 |
#else |
494 |
return (*gNetscapeFuncs.invokeDefault)(npp, obj, args, argCount, result); |
495 |
#endif |
496 |
return false; |
497 |
} |
285 |
} |
498 |
|
286 |
|
499 |
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script, |
287 |
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script, |
500 |
NPVariant *result) |
288 |
NPVariant *result) |
501 |
{ |
289 |
{ |
502 |
int minor = gNetscapeFuncs.version & 0xFF; |
290 |
return (*gNetscapeFuncs.evaluate)(npp, obj, script, result); |
503 |
if( minor >= 14 ) |
|
|
504 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
505 |
return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj, |
506 |
script, result); |
507 |
#else |
508 |
return (*gNetscapeFuncs.evaluate)(npp, obj, script, result); |
509 |
#endif |
510 |
return false; |
511 |
} |
291 |
} |
512 |
|
292 |
|
513 |
bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, |
293 |
bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, |
514 |
NPVariant *result) |
294 |
NPVariant *result) |
515 |
{ |
295 |
{ |
516 |
int minor = gNetscapeFuncs.version & 0xFF; |
296 |
return (*gNetscapeFuncs.getproperty)(npp, obj, propertyName, result); |
517 |
if( minor >= 14 ) |
|
|
518 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
519 |
return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj, |
520 |
propertyName, result); |
521 |
#else |
522 |
return (*gNetscapeFuncs.getproperty)(npp, obj, propertyName, result); |
523 |
#endif |
524 |
return false; |
525 |
} |
297 |
} |
526 |
|
298 |
|
527 |
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, |
299 |
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, |
528 |
const NPVariant *value) |
300 |
const NPVariant *value) |
529 |
{ |
301 |
{ |
530 |
int minor = gNetscapeFuncs.version & 0xFF; |
302 |
return (*gNetscapeFuncs.setproperty)(npp, obj, propertyName, value); |
531 |
if( minor >= 14 ) |
|
|
532 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
533 |
return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj, |
534 |
propertyName, value); |
535 |
#else |
536 |
return (*gNetscapeFuncs.setproperty)(npp, obj, propertyName, value); |
537 |
#endif |
538 |
return false; |
539 |
} |
303 |
} |
540 |
|
304 |
|
541 |
bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) |
305 |
bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) |
542 |
{ |
306 |
{ |
543 |
int minor = gNetscapeFuncs.version & 0xFF; |
307 |
return (*gNetscapeFuncs.removeproperty)(npp, obj, propertyName); |
544 |
if( minor >= 14 ) |
|
|
545 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
546 |
return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj, |
547 |
propertyName); |
548 |
#else |
549 |
return (*gNetscapeFuncs.removeproperty)(npp, obj, propertyName); |
550 |
#endif |
551 |
return false; |
552 |
} |
308 |
} |
553 |
|
309 |
|
554 |
bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) |
310 |
bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) |
555 |
{ |
311 |
{ |
556 |
int minor = gNetscapeFuncs.version & 0xFF; |
312 |
return (*gNetscapeFuncs.hasproperty)(npp, obj, propertyName); |
557 |
if( minor >= 14 ) |
|
|
558 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
559 |
return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj, |
560 |
propertyName); |
561 |
#else |
562 |
return (*gNetscapeFuncs.hasproperty)(npp, obj, propertyName); |
563 |
#endif |
564 |
return false; |
565 |
} |
313 |
} |
566 |
|
314 |
|
567 |
bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName) |
315 |
bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName) |
568 |
{ |
316 |
{ |
569 |
int minor = gNetscapeFuncs.version & 0xFF; |
317 |
return (*gNetscapeFuncs.hasmethod)(npp, obj, methodName); |
570 |
if( minor >= 14 ) |
|
|
571 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
572 |
return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp, |
573 |
obj, methodName); |
574 |
#else |
575 |
return (*gNetscapeFuncs.hasmethod)(npp, obj, methodName); |
576 |
#endif |
577 |
return false; |
578 |
} |
318 |
} |
579 |
|
319 |
|
580 |
void NPN_ReleaseVariantValue(NPVariant *variant) |
320 |
void NPN_ReleaseVariantValue(NPVariant *variant) |
581 |
{ |
321 |
{ |
582 |
int minor = gNetscapeFuncs.version & 0xFF; |
322 |
(*gNetscapeFuncs.releasevariantvalue)(variant); |
583 |
if( minor >= 14 ) |
|
|
584 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
585 |
CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant); |
586 |
#else |
587 |
(*gNetscapeFuncs.releasevariantvalue)(variant); |
588 |
#endif |
589 |
} |
323 |
} |
590 |
|
324 |
|
591 |
void NPN_SetException(NPObject* obj, const NPUTF8 *message) |
325 |
void NPN_SetException(NPObject* obj, const NPUTF8 *message) |
592 |
{ |
326 |
{ |
593 |
int minor = gNetscapeFuncs.version & 0xFF; |
327 |
(*gNetscapeFuncs.setexception)(obj, message); |
594 |
if( minor >= 14 ) |
|
|
595 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
596 |
CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message); |
597 |
#else |
598 |
(*gNetscapeFuncs.setexception)(obj, message); |
599 |
#endif |
600 |
} |
328 |
} |
601 |
|
329 |
|
|
|
330 |
|
602 |
/*********************************************************************** |
331 |
/*********************************************************************** |
603 |
* |
332 |
* |
604 |
* Wrapper functions : Netscape Navigator -> plugin |
333 |
* Wrapper functions : Netscape Navigator -> plugin |
Lines 610-637
void NPN_SetException(NPObject* obj, con
Link Here
|
610 |
* |
339 |
* |
611 |
***********************************************************************/ |
340 |
***********************************************************************/ |
612 |
|
341 |
|
613 |
/* Function prototypes */ |
|
|
614 |
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, |
615 |
int16_t argc, char* argn[], char* argv[], NPSavedData* saved); |
616 |
NPError Private_Destroy(NPP instance, NPSavedData** save); |
617 |
NPError Private_SetWindow(NPP instance, NPWindow* window); |
618 |
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, |
619 |
NPBool seekable, uint16_t* stype); |
620 |
int32_t Private_WriteReady(NPP instance, NPStream* stream); |
621 |
int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, |
622 |
int32_t len, void* buffer); |
623 |
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname); |
624 |
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason); |
625 |
void Private_URLNotify(NPP instance, const char* url, |
626 |
NPReason reason, void* notifyData); |
627 |
void Private_Print(NPP instance, NPPrint* platformPrint); |
628 |
NPError Private_GetValue(NPP instance, NPPVariable variable, void *r_value); |
629 |
NPError Private_SetValue(NPP instance, NPPVariable variable, void *r_value); |
630 |
#ifdef OJI |
631 |
JRIGlobalRef Private_GetJavaClass(void); |
632 |
#endif |
633 |
|
634 |
/* function implementations */ |
635 |
NPError |
342 |
NPError |
636 |
Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, |
343 |
Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, |
637 |
int16_t argc, char* argn[], char* argv[], NPSavedData* saved) |
344 |
int16_t argc, char* argn[], char* argv[], NPSavedData* saved) |
Lines 707-717
Private_DestroyStream(NPP instance, NPSt
Link Here
|
707 |
void |
414 |
void |
708 |
Private_URLNotify(NPP instance, const char* url, |
415 |
Private_URLNotify(NPP instance, const char* url, |
709 |
NPReason reason, void* notifyData) |
416 |
NPReason reason, void* notifyData) |
|
|
417 |
|
710 |
{ |
418 |
{ |
711 |
PLUGINDEBUGSTR("URLNotify"); |
419 |
PLUGINDEBUGSTR("URLNotify"); |
712 |
NPP_URLNotify(instance, url, reason, notifyData); |
420 |
NPP_URLNotify(instance, url, reason, notifyData); |
713 |
} |
421 |
} |
714 |
|
422 |
|
|
|
423 |
|
424 |
|
715 |
void |
425 |
void |
716 |
Private_Print(NPP instance, NPPrint* platformPrint) |
426 |
Private_Print(NPP instance, NPPrint* platformPrint) |
717 |
{ |
427 |
{ |
Lines 719-751
Private_Print(NPP instance, NPPrint* pla
Link Here
|
719 |
NPP_Print(instance, platformPrint); |
429 |
NPP_Print(instance, platformPrint); |
720 |
} |
430 |
} |
721 |
|
431 |
|
722 |
NPError |
|
|
723 |
Private_GetValue(NPP instance, NPPVariable variable, void *r_value) |
724 |
{ |
725 |
PLUGINDEBUGSTR("GetValue"); |
726 |
return NPP_GetValue(instance, variable, r_value); |
727 |
} |
728 |
|
729 |
NPError |
730 |
Private_SetValue(NPP instance, NPPVariable variable, void *r_value) |
731 |
{ |
732 |
PLUGINDEBUGSTR("SetValue"); |
733 |
return NPP_SetValue(instance, variable, r_value); |
734 |
} |
735 |
|
736 |
#ifdef OJI |
737 |
JRIGlobalRef |
738 |
Private_GetJavaClass(void) |
739 |
{ |
740 |
jref clazz = NPP_GetJavaClass(); |
741 |
if (clazz) { |
742 |
JRIEnv* env = NPN_GetJavaEnv(); |
743 |
return JRI_NewGlobalRef(env, clazz); |
744 |
} |
745 |
return NULL; |
746 |
} |
747 |
#endif |
748 |
|
749 |
/*********************************************************************** |
432 |
/*********************************************************************** |
750 |
* |
433 |
* |
751 |
* These functions are located automagically by netscape. |
434 |
* These functions are located automagically by netscape. |
Lines 753-758
Private_GetJavaClass(void)
Link Here
|
753 |
***********************************************************************/ |
436 |
***********************************************************************/ |
754 |
|
437 |
|
755 |
/* |
438 |
/* |
|
|
439 |
* NP_GetPluginVersion [optional] |
440 |
* - The browser uses the return value to indicate to the user what version of |
441 |
* this plugin is installed. |
442 |
*/ |
443 |
char * |
444 |
NP_GetPluginVersion(void) |
445 |
{ |
446 |
return "1.0.0.15"; |
447 |
} |
448 |
|
449 |
/* |
756 |
* NP_GetMIMEDescription |
450 |
* NP_GetMIMEDescription |
757 |
* - Netscape needs to know about this symbol |
451 |
* - Netscape needs to know about this symbol |
758 |
* - Netscape uses the return value to identify when an object instance |
452 |
* - Netscape uses the return value to identify when an object instance |
Lines 799-809
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
799 |
NPError err = NPERR_NO_ERROR; |
493 |
NPError err = NPERR_NO_ERROR; |
800 |
|
494 |
|
801 |
PLUGINDEBUGSTR("NP_Initialize"); |
495 |
PLUGINDEBUGSTR("NP_Initialize"); |
802 |
|
496 |
|
803 |
/* validate input parameters */ |
497 |
/* validate input parameters */ |
|
|
498 |
|
804 |
if ((nsTable == NULL) || (pluginFuncs == NULL)) |
499 |
if ((nsTable == NULL) || (pluginFuncs == NULL)) |
805 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
500 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
806 |
|
501 |
|
807 |
/* |
502 |
/* |
808 |
* Check the major version passed in Netscape's function table. |
503 |
* Check the major version passed in Netscape's function table. |
809 |
* We won't load if the major version is newer than what we expect. |
504 |
* We won't load if the major version is newer than what we expect. |
Lines 812-828
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
812 |
* new APIs, but that's OK with us -- we'll just ignore them). |
507 |
* new APIs, but that's OK with us -- we'll just ignore them). |
813 |
* |
508 |
* |
814 |
*/ |
509 |
*/ |
|
|
510 |
|
815 |
if (err == NPERR_NO_ERROR) { |
511 |
if (err == NPERR_NO_ERROR) { |
816 |
if ((nsTable->version >> 8) > NP_VERSION_MAJOR) |
512 |
if ((nsTable->version >> 8) > NP_VERSION_MAJOR) |
817 |
err = NPERR_INCOMPATIBLE_VERSION_ERROR; |
513 |
err = NPERR_INCOMPATIBLE_VERSION_ERROR; |
818 |
if (nsTable->size < ((char *)&nsTable->posturlnotify - (char *)nsTable)) |
514 |
if (nsTable->size < ((char *)&nsTable->posturlnotify - (char *)nsTable)) |
819 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
515 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
820 |
if (pluginFuncs->size < sizeof(NPPluginFuncs)) |
516 |
if (pluginFuncs->size < sizeof(NPPluginFuncs)) |
821 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
517 |
err = NPERR_INVALID_FUNCTABLE_ERROR; |
822 |
} |
518 |
} |
823 |
|
519 |
|
824 |
if (err == NPERR_NO_ERROR) |
520 |
|
825 |
{ |
521 |
if (err == NPERR_NO_ERROR) { |
826 |
/* |
522 |
/* |
827 |
* Copy all the fields of Netscape function table into our |
523 |
* Copy all the fields of Netscape function table into our |
828 |
* copy so we can call back into Netscape later. Note that |
524 |
* copy so we can call back into Netscape later. Note that |
Lines 830-841
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
830 |
* the whole structure, because the Netscape function table |
526 |
* the whole structure, because the Netscape function table |
831 |
* could actually be bigger than what we expect. |
527 |
* could actually be bigger than what we expect. |
832 |
*/ |
528 |
*/ |
833 |
int minor = nsTable->version & 0xFF; |
|
|
834 |
|
835 |
gNetscapeFuncs.version = nsTable->version; |
529 |
gNetscapeFuncs.version = nsTable->version; |
836 |
gNetscapeFuncs.size = nsTable->size; |
530 |
gNetscapeFuncs.size = nsTable->size; |
837 |
gNetscapeFuncs.posturl = nsTable->posturl; |
531 |
gNetscapeFuncs.posturl = nsTable->posturl; |
838 |
gNetscapeFuncs.geturl = nsTable->geturl; |
532 |
gNetscapeFuncs.geturl = nsTable->geturl; |
|
|
533 |
gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; |
839 |
gNetscapeFuncs.requestread = nsTable->requestread; |
534 |
gNetscapeFuncs.requestread = nsTable->requestread; |
840 |
gNetscapeFuncs.newstream = nsTable->newstream; |
535 |
gNetscapeFuncs.newstream = nsTable->newstream; |
841 |
gNetscapeFuncs.write = nsTable->write; |
536 |
gNetscapeFuncs.write = nsTable->write; |
Lines 846-930
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
846 |
gNetscapeFuncs.memfree = nsTable->memfree; |
541 |
gNetscapeFuncs.memfree = nsTable->memfree; |
847 |
gNetscapeFuncs.memflush = nsTable->memflush; |
542 |
gNetscapeFuncs.memflush = nsTable->memflush; |
848 |
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; |
543 |
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; |
849 |
#ifdef OJI |
|
|
850 |
if( minor >= NPVERS_HAS_LIVECONNECT ) |
851 |
{ |
852 |
gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; |
853 |
gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; |
854 |
} |
855 |
#endif |
856 |
gNetscapeFuncs.getvalue = nsTable->getvalue; |
544 |
gNetscapeFuncs.getvalue = nsTable->getvalue; |
857 |
gNetscapeFuncs.setvalue = nsTable->setvalue; |
545 |
gNetscapeFuncs.setvalue = nsTable->setvalue; |
858 |
|
546 |
gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; |
859 |
if( minor >= NPVERS_HAS_NOTIFICATION ) |
|
|
860 |
{ |
861 |
gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; |
862 |
gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; |
863 |
} |
864 |
|
547 |
|
865 |
if (nsTable->size >= ((char *)&nsTable->setexception - (char *)nsTable)) |
548 |
if (nsTable->size >= ((char *)&nsTable->setexception - (char *)nsTable)) |
866 |
{ |
549 |
{ |
867 |
gNetscapeFuncs.invalidaterect = nsTable->invalidaterect; |
550 |
gNetscapeFuncs.invalidaterect = nsTable->invalidaterect; |
868 |
gNetscapeFuncs.invalidateregion = nsTable->invalidateregion; |
551 |
gNetscapeFuncs.invalidateregion = nsTable->invalidateregion; |
869 |
gNetscapeFuncs.forceredraw = nsTable->forceredraw; |
552 |
gNetscapeFuncs.forceredraw = nsTable->forceredraw; |
870 |
/* npruntime support */ |
553 |
gNetscapeFuncs.getstringidentifier = nsTable->getstringidentifier; |
871 |
if (minor >= 14) |
554 |
gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers; |
872 |
{ |
555 |
gNetscapeFuncs.getintidentifier = nsTable->getintidentifier; |
873 |
gNetscapeFuncs.getstringidentifier = nsTable->getstringidentifier; |
556 |
gNetscapeFuncs.identifierisstring = nsTable->identifierisstring; |
874 |
gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers; |
557 |
gNetscapeFuncs.utf8fromidentifier = nsTable->utf8fromidentifier; |
875 |
gNetscapeFuncs.getintidentifier = nsTable->getintidentifier; |
558 |
gNetscapeFuncs.intfromidentifier = nsTable->intfromidentifier; |
876 |
gNetscapeFuncs.identifierisstring = nsTable->identifierisstring; |
559 |
gNetscapeFuncs.createobject = nsTable->createobject; |
877 |
gNetscapeFuncs.utf8fromidentifier = nsTable->utf8fromidentifier; |
560 |
gNetscapeFuncs.retainobject = nsTable->retainobject; |
878 |
gNetscapeFuncs.intfromidentifier = nsTable->intfromidentifier; |
561 |
gNetscapeFuncs.releaseobject = nsTable->releaseobject; |
879 |
gNetscapeFuncs.createobject = nsTable->createobject; |
562 |
gNetscapeFuncs.invoke = nsTable->invoke; |
880 |
gNetscapeFuncs.retainobject = nsTable->retainobject; |
563 |
gNetscapeFuncs.invokeDefault = nsTable->invokeDefault; |
881 |
gNetscapeFuncs.releaseobject = nsTable->releaseobject; |
564 |
gNetscapeFuncs.evaluate = nsTable->evaluate; |
882 |
gNetscapeFuncs.invoke = nsTable->invoke; |
565 |
gNetscapeFuncs.getproperty = nsTable->getproperty; |
883 |
gNetscapeFuncs.invokeDefault = nsTable->invokeDefault; |
566 |
gNetscapeFuncs.setproperty = nsTable->setproperty; |
884 |
gNetscapeFuncs.evaluate = nsTable->evaluate; |
567 |
gNetscapeFuncs.removeproperty = nsTable->removeproperty; |
885 |
gNetscapeFuncs.getproperty = nsTable->getproperty; |
568 |
gNetscapeFuncs.hasproperty = nsTable->hasproperty; |
886 |
gNetscapeFuncs.setproperty = nsTable->setproperty; |
569 |
gNetscapeFuncs.hasmethod = nsTable->hasmethod; |
887 |
gNetscapeFuncs.removeproperty = nsTable->removeproperty; |
570 |
gNetscapeFuncs.releasevariantvalue = nsTable->releasevariantvalue; |
888 |
gNetscapeFuncs.hasproperty = nsTable->hasproperty; |
571 |
gNetscapeFuncs.setexception = nsTable->setexception; |
889 |
gNetscapeFuncs.hasmethod = nsTable->hasmethod; |
|
|
890 |
gNetscapeFuncs.releasevariantvalue = nsTable->releasevariantvalue; |
891 |
gNetscapeFuncs.setexception = nsTable->setexception; |
892 |
} |
893 |
} |
572 |
} |
894 |
else |
573 |
else |
895 |
{ |
574 |
{ |
896 |
gNetscapeFuncs.invalidaterect = NULL; |
575 |
gNetscapeFuncs.invalidaterect = NULL; |
897 |
gNetscapeFuncs.invalidateregion = NULL; |
576 |
gNetscapeFuncs.invalidateregion = NULL; |
898 |
gNetscapeFuncs.forceredraw = NULL; |
577 |
gNetscapeFuncs.forceredraw = NULL; |
899 |
gNetscapeFuncs.getstringidentifier = NULL; |
578 |
gNetscapeFuncs.getstringidentifier = NULL; |
900 |
gNetscapeFuncs.getstringidentifiers = NULL; |
579 |
gNetscapeFuncs.getstringidentifiers = NULL; |
901 |
gNetscapeFuncs.getintidentifier = NULL; |
580 |
gNetscapeFuncs.getintidentifier = NULL; |
902 |
gNetscapeFuncs.identifierisstring = NULL; |
581 |
gNetscapeFuncs.identifierisstring = NULL; |
903 |
gNetscapeFuncs.utf8fromidentifier = NULL; |
582 |
gNetscapeFuncs.utf8fromidentifier = NULL; |
904 |
gNetscapeFuncs.intfromidentifier = NULL; |
583 |
gNetscapeFuncs.intfromidentifier = NULL; |
905 |
gNetscapeFuncs.createobject = NULL; |
584 |
gNetscapeFuncs.createobject = NULL; |
906 |
gNetscapeFuncs.retainobject = NULL; |
585 |
gNetscapeFuncs.retainobject = NULL; |
907 |
gNetscapeFuncs.releaseobject = NULL; |
586 |
gNetscapeFuncs.releaseobject = NULL; |
908 |
gNetscapeFuncs.invoke = NULL; |
587 |
gNetscapeFuncs.invoke = NULL; |
909 |
gNetscapeFuncs.invokeDefault = NULL; |
588 |
gNetscapeFuncs.invokeDefault = NULL; |
910 |
gNetscapeFuncs.evaluate = NULL; |
589 |
gNetscapeFuncs.evaluate = NULL; |
911 |
gNetscapeFuncs.getproperty = NULL; |
590 |
gNetscapeFuncs.getproperty = NULL; |
912 |
gNetscapeFuncs.setproperty = NULL; |
591 |
gNetscapeFuncs.setproperty = NULL; |
913 |
gNetscapeFuncs.removeproperty = NULL; |
592 |
gNetscapeFuncs.removeproperty = NULL; |
914 |
gNetscapeFuncs.hasproperty = NULL; |
593 |
gNetscapeFuncs.hasproperty = NULL; |
915 |
gNetscapeFuncs.releasevariantvalue = NULL; |
594 |
gNetscapeFuncs.releasevariantvalue = NULL; |
916 |
gNetscapeFuncs.setexception = NULL; |
595 |
gNetscapeFuncs.setexception = NULL; |
917 |
} |
596 |
} |
918 |
if (nsTable->size >= |
597 |
if (nsTable->size >= |
919 |
((char *)&nsTable->poppopupsenabledstate - (char *)nsTable)) |
598 |
((char *)&nsTable->poppopupsenabledstate - (char *)nsTable)) |
920 |
{ |
599 |
{ |
921 |
gNetscapeFuncs.pushpopupsenabledstate = nsTable->pushpopupsenabledstate; |
600 |
gNetscapeFuncs.pushpopupsenabledstate = nsTable->pushpopupsenabledstate; |
922 |
gNetscapeFuncs.poppopupsenabledstate = nsTable->poppopupsenabledstate; |
601 |
gNetscapeFuncs.poppopupsenabledstate = nsTable->poppopupsenabledstate; |
923 |
} |
602 |
} |
924 |
else |
603 |
else |
925 |
{ |
604 |
{ |
926 |
gNetscapeFuncs.pushpopupsenabledstate = NULL; |
605 |
gNetscapeFuncs.pushpopupsenabledstate = NULL; |
927 |
gNetscapeFuncs.poppopupsenabledstate = NULL; |
606 |
gNetscapeFuncs.poppopupsenabledstate = NULL; |
928 |
} |
607 |
} |
929 |
|
608 |
|
930 |
/* |
609 |
/* |
Lines 935-953
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
935 |
*/ |
614 |
*/ |
936 |
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; |
615 |
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; |
937 |
pluginFuncs->size = sizeof(NPPluginFuncs); |
616 |
pluginFuncs->size = sizeof(NPPluginFuncs); |
938 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
|
|
939 |
pluginFuncs->newp = NewNPP_NewProc(Private_New); |
940 |
pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); |
941 |
pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); |
942 |
pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream); |
943 |
pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream); |
944 |
pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile); |
945 |
pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady); |
946 |
pluginFuncs->write = NewNPP_WriteProc(Private_Write); |
947 |
pluginFuncs->print = NewNPP_PrintProc(Private_Print); |
948 |
pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue); |
949 |
pluginFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue); |
950 |
#else |
951 |
pluginFuncs->newp = (NPP_NewProcPtr)(Private_New); |
617 |
pluginFuncs->newp = (NPP_NewProcPtr)(Private_New); |
952 |
pluginFuncs->destroy = (NPP_DestroyProcPtr)(Private_Destroy); |
618 |
pluginFuncs->destroy = (NPP_DestroyProcPtr)(Private_Destroy); |
953 |
pluginFuncs->setwindow = (NPP_SetWindowProcPtr)(Private_SetWindow); |
619 |
pluginFuncs->setwindow = (NPP_SetWindowProcPtr)(Private_SetWindow); |
Lines 957-986
NP_Initialize(NPNetscapeFuncs* nsTable,
Link Here
|
957 |
pluginFuncs->writeready = (NPP_WriteReadyProcPtr)(Private_WriteReady); |
623 |
pluginFuncs->writeready = (NPP_WriteReadyProcPtr)(Private_WriteReady); |
958 |
pluginFuncs->write = (NPP_WriteProcPtr)(Private_Write); |
624 |
pluginFuncs->write = (NPP_WriteProcPtr)(Private_Write); |
959 |
pluginFuncs->print = (NPP_PrintProcPtr)(Private_Print); |
625 |
pluginFuncs->print = (NPP_PrintProcPtr)(Private_Print); |
960 |
pluginFuncs->getvalue = (NPP_GetValueProcPtr)(Private_GetValue); |
626 |
pluginFuncs->urlnotify = (NPP_URLNotifyProcPtr)(Private_URLNotify); |
961 |
pluginFuncs->setvalue = (NPP_SetValueProcPtr)(Private_SetValue); |
|
|
962 |
#endif |
963 |
pluginFuncs->event = NULL; |
627 |
pluginFuncs->event = NULL; |
964 |
if( minor >= NPVERS_HAS_NOTIFICATION ) |
628 |
pluginFuncs->javaClass = NULL; |
965 |
{ |
629 |
|
966 |
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20) |
630 |
// This function is supposedly loaded magically, but that doesn't |
967 |
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify); |
631 |
// seem to be true. |
968 |
#else |
632 |
pluginFuncs->getvalue = (NPP_GetValueProcPtr)(NP_GetValue); |
969 |
pluginFuncs->urlnotify = (NPP_URLNotifyProcPtr)(Private_URLNotify); |
|
|
970 |
#endif |
971 |
} |
972 |
#ifdef OJI |
973 |
if( minor >= NPVERS_HAS_LIVECONNECT ) |
974 |
pluginFuncs->javaClass = Private_GetJavaClass(); |
975 |
else |
976 |
pluginFuncs->javaClass = NULL; |
977 |
#else |
978 |
pluginFuncs->javaClass = NULL; |
979 |
#endif |
980 |
|
633 |
|
981 |
err = NPP_Initialize(); |
634 |
err = NPP_Initialize(); |
982 |
} |
635 |
} |
983 |
|
636 |
|
984 |
return err; |
637 |
return err; |
985 |
} |
638 |
} |
986 |
|
639 |
|