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