Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / nsplugins / sdk / npupp.h
blobb9b80a0881b7fd9b15dc275c2587eaaf6f867728
1 //krazy:excludeall=copyright
2 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
16 * The Original Code is mozilla.org code.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
41 * npupp.h, original dollar-revision: 3.20
42 * function call mecahnics needed by platform specific glue code.
46 #ifndef _NPUPP_H_
47 #define _NPUPP_H_
49 #if defined(__OS2__)
50 #pragma pack(1)
51 #endif
53 #ifndef GENERATINGCFM
54 #define GENERATINGCFM 0
55 #endif
57 #ifndef _NPAPI_H_
58 #include "npapi.h"
59 #endif
61 #include "npruntime.h"
63 #include "jri.h"
65 /******************************************************************************************
66 plug-in function table macros
67 for each function in and out of the plugin API we define
68 typedef NPP_FooUPP
69 #define NewNPP_FooProc
70 #define CallNPP_FooProc
71 for mac, define the UPP magic for PPC/68K calling
72 *******************************************************************************************/
75 /* NPP_Initialize */
77 #define _NPUPP_USE_UPP_ 0
79 #if _NPUPP_USE_UPP_
80 typedef UniversalProcPtr NPP_InitializeUPP;
82 enum {
83 uppNPP_InitializeProcInfo = kThinkCStackBased
84 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
85 | RESULT_SIZE(SIZE_CODE(0))
88 #define NewNPP_InitializeProc(FUNC) \
89 (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
90 #define CallNPP_InitializeProc(FUNC) \
91 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
93 #else
95 typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
96 #define NewNPP_InitializeProc(FUNC) \
97 ((NPP_InitializeUPP) (FUNC))
98 #define CallNPP_InitializeProc(FUNC) \
99 (*(FUNC))()
101 #endif
104 /* NPP_Shutdown */
106 #if _NPUPP_USE_UPP_
107 typedef UniversalProcPtr NPP_ShutdownUPP;
109 enum {
110 uppNPP_ShutdownProcInfo = kThinkCStackBased
111 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
112 | RESULT_SIZE(SIZE_CODE(0))
115 #define NewNPP_ShutdownProc(FUNC) \
116 (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
117 #define CallNPP_ShutdownProc(FUNC) \
118 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
120 #else
122 typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
123 #define NewNPP_ShutdownProc(FUNC) \
124 ((NPP_ShutdownUPP) (FUNC))
125 #define CallNPP_ShutdownProc(FUNC) \
126 (*(FUNC))()
128 #endif
131 /* NPP_New */
133 #if _NPUPP_USE_UPP_
134 typedef UniversalProcPtr NPP_NewUPP;
136 enum {
137 uppNPP_NewProcInfo = kThinkCStackBased
138 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
139 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
140 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
141 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
142 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
143 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
144 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
145 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
148 #define NewNPP_NewProc(FUNC) \
149 (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
150 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
151 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
152 (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
153 #else
155 typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
156 #define NewNPP_NewProc(FUNC) \
157 ((NPP_NewUPP) (FUNC))
158 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
159 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
161 #endif
164 /* NPP_Destroy */
166 #if _NPUPP_USE_UPP_
168 typedef UniversalProcPtr NPP_DestroyUPP;
169 enum {
170 uppNPP_DestroyProcInfo = kThinkCStackBased
171 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
172 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
173 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
175 #define NewNPP_DestroyProc(FUNC) \
176 (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
177 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
178 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
179 #else
181 typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
182 #define NewNPP_DestroyProc(FUNC) \
183 ((NPP_DestroyUPP) (FUNC))
184 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
185 (*(FUNC))((ARG1), (ARG2))
187 #endif
190 /* NPP_SetWindow */
192 #if _NPUPP_USE_UPP_
194 typedef UniversalProcPtr NPP_SetWindowUPP;
195 enum {
196 uppNPP_SetWindowProcInfo = kThinkCStackBased
197 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
198 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
199 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
201 #define NewNPP_SetWindowProc(FUNC) \
202 (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
203 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
204 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
206 #else
208 typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
209 #define NewNPP_SetWindowProc(FUNC) \
210 ((NPP_SetWindowUPP) (FUNC))
211 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
212 (*(FUNC))((ARG1), (ARG2))
214 #endif
217 /* NPP_NewStream */
219 #if _NPUPP_USE_UPP_
221 typedef UniversalProcPtr NPP_NewStreamUPP;
222 enum {
223 uppNPP_NewStreamProcInfo = kThinkCStackBased
224 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
225 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
226 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
227 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
228 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
229 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
231 #define NewNPP_NewStreamProc(FUNC) \
232 (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
233 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
234 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
235 #else
237 typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
238 #define NewNPP_NewStreamProc(FUNC) \
239 ((NPP_NewStreamUPP) (FUNC))
240 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
241 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
242 #endif
245 /* NPP_DestroyStream */
247 #if _NPUPP_USE_UPP_
249 typedef UniversalProcPtr NPP_DestroyStreamUPP;
250 enum {
251 uppNPP_DestroyStreamProcInfo = kThinkCStackBased
252 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
253 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
254 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
255 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
257 #define NewNPP_DestroyStreamProc(FUNC) \
258 (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
259 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
260 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
262 #else
264 typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
265 #define NewNPP_DestroyStreamProc(FUNC) \
266 ((NPP_DestroyStreamUPP) (FUNC))
267 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
268 (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
270 #endif
273 /* NPP_WriteReady */
275 #if _NPUPP_USE_UPP_
277 typedef UniversalProcPtr NPP_WriteReadyUPP;
278 enum {
279 uppNPP_WriteReadyProcInfo = kThinkCStackBased
280 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
281 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
282 | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
284 #define NewNPP_WriteReadyProc(FUNC) \
285 (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
286 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
287 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
289 #else
291 typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
292 #define NewNPP_WriteReadyProc(FUNC) \
293 ((NPP_WriteReadyUPP) (FUNC))
294 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
295 (*(FUNC))((NPParg), (NPStreamPtr))
297 #endif
300 /* NPP_Write */
302 #if _NPUPP_USE_UPP_
304 typedef UniversalProcPtr NPP_WriteUPP;
305 enum {
306 uppNPP_WriteProcInfo = kThinkCStackBased
307 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
308 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
309 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
310 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
311 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
312 | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
314 #define NewNPP_WriteProc(FUNC) \
315 (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
316 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
317 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
319 #else
321 typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
322 #define NewNPP_WriteProc(FUNC) \
323 ((NPP_WriteUPP) (FUNC))
324 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
325 (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
327 #endif
330 /* NPP_StreamAsFile */
332 #if _NPUPP_USE_UPP_
334 typedef UniversalProcPtr NPP_StreamAsFileUPP;
335 enum {
336 uppNPP_StreamAsFileProcInfo = kThinkCStackBased
337 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
338 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
339 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
340 | RESULT_SIZE(SIZE_CODE(0))
342 #define NewNPP_StreamAsFileProc(FUNC) \
343 (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
344 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
345 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
347 #else
349 typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
350 #define NewNPP_StreamAsFileProc(FUNC) \
351 ((NPP_StreamAsFileUPP) (FUNC))
352 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
353 (*(FUNC))((ARG1), (ARG2), (ARG3))
354 #endif
357 /* NPP_Print */
359 #if _NPUPP_USE_UPP_
361 typedef UniversalProcPtr NPP_PrintUPP;
362 enum {
363 uppNPP_PrintProcInfo = kThinkCStackBased
364 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
365 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
366 | RESULT_SIZE(SIZE_CODE(0))
368 #define NewNPP_PrintProc(FUNC) \
369 (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
370 #define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \
371 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
373 #else
375 typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
376 #define NewNPP_PrintProc(FUNC) \
377 ((NPP_PrintUPP) (FUNC))
378 #define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
379 (*(FUNC))((NPParg), (NPPrintArg))
381 #endif
384 /* NPP_HandleEvent */
386 #if _NPUPP_USE_UPP_
388 typedef UniversalProcPtr NPP_HandleEventUPP;
389 enum {
390 uppNPP_HandleEventProcInfo = kThinkCStackBased
391 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
392 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
393 | RESULT_SIZE(SIZE_CODE(sizeof(int16)))
395 #define NewNPP_HandleEventProc(FUNC) \
396 (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
397 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
398 (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
400 #else
402 typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
403 #define NewNPP_HandleEventProc(FUNC) \
404 ((NPP_HandleEventUPP) (FUNC))
405 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
406 (*(FUNC))((NPParg), (voidPtr))
408 #endif
411 /* NPP_URLNotify */
413 #if _NPUPP_USE_UPP_
415 typedef UniversalProcPtr NPP_URLNotifyUPP;
416 enum {
417 uppNPP_URLNotifyProcInfo = kThinkCStackBased
418 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
419 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
420 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
421 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
422 | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
424 #define NewNPP_URLNotifyProc(FUNC) \
425 (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
426 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
427 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
429 #else
431 typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
432 #define NewNPP_URLNotifyProc(FUNC) \
433 ((NPP_URLNotifyUPP) (FUNC))
434 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
435 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
437 #endif
440 /* NPP_GetValue */
442 #if _NPUPP_USE_UPP_
444 typedef UniversalProcPtr NPP_GetValueUPP;
445 enum {
446 uppNPP_GetValueProcInfo = kThinkCStackBased
447 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
448 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
449 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
450 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
452 #define NewNPP_GetValueProc(FUNC) \
453 (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
454 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
455 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
456 #else
458 typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
459 #define NewNPP_GetValueProc(FUNC) \
460 ((NPP_GetValueUPP) (FUNC))
461 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
462 (*(FUNC))((ARG1), (ARG2), (ARG3))
463 #endif
466 /* NPP_SetValue */
468 #if _NPUPP_USE_UPP_
470 typedef UniversalProcPtr NPP_SetValueUPP;
471 enum {
472 uppNPP_SetValueProcInfo = kThinkCStackBased
473 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
474 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
475 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
476 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
478 #define NewNPP_SetValueProc(FUNC) \
479 (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
480 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
481 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
482 #else
484 typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
485 #define NewNPP_SetValueProc(FUNC) \
486 ((NPP_SetValueUPP) (FUNC))
487 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
488 (*(FUNC))((ARG1), (ARG2), (ARG3))
489 #endif
493 * Netscape entry points
497 /* NPN_GetValue */
499 #if _NPUPP_USE_UPP_
501 typedef UniversalProcPtr NPN_GetValueUPP;
502 enum {
503 uppNPN_GetValueProcInfo = kThinkCStackBased
504 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
505 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
506 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
507 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
509 #define NewNPN_GetValueProc(FUNC) \
510 (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
511 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
512 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
513 #else
515 typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
516 #define NewNPN_GetValueProc(FUNC) \
517 ((NPN_GetValueUPP) (FUNC))
518 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
519 (*(FUNC))((ARG1), (ARG2), (ARG3))
520 #endif
523 /* NPN_SetValue */
525 #if _NPUPP_USE_UPP_
527 typedef UniversalProcPtr NPN_SetValueUPP;
528 enum {
529 uppNPN_SetValueProcInfo = kThinkCStackBased
530 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
531 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
532 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
533 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
535 #define NewNPN_SetValueProc(FUNC) \
536 (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
537 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
538 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
539 #else
541 typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
542 #define NewNPN_SetValueProc(FUNC) \
543 ((NPN_SetValueUPP) (FUNC))
544 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
545 (*(FUNC))((ARG1), (ARG2), (ARG3))
546 #endif
549 /* NPN_GetUrlNotify */
551 #if _NPUPP_USE_UPP_
553 typedef UniversalProcPtr NPN_GetURLNotifyUPP;
554 enum {
555 uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
556 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
557 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
558 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
559 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
560 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
562 #define NewNPN_GetURLNotifyProc(FUNC) \
563 (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
564 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
565 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
566 #else
568 typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
569 #define NewNPN_GetURLNotifyProc(FUNC) \
570 ((NPN_GetURLNotifyUPP) (FUNC))
571 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
572 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
573 #endif
576 /* NPN_PostUrlNotify */
578 #if _NPUPP_USE_UPP_
580 typedef UniversalProcPtr NPN_PostURLNotifyUPP;
581 enum {
582 uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
583 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
584 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
585 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
586 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
587 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
588 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
589 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
590 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
592 #define NewNPN_PostURLNotifyProc(FUNC) \
593 (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
594 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
595 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
596 #else
598 typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
599 #define NewNPN_PostURLNotifyProc(FUNC) \
600 ((NPN_PostURLNotifyUPP) (FUNC))
601 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
602 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
603 #endif
606 /* NPN_GetUrl */
608 #if _NPUPP_USE_UPP_
610 typedef UniversalProcPtr NPN_GetURLUPP;
611 enum {
612 uppNPN_GetURLProcInfo = kThinkCStackBased
613 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
614 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
615 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
616 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
618 #define NewNPN_GetURLProc(FUNC) \
619 (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
620 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
621 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
622 #else
624 typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
625 #define NewNPN_GetURLProc(FUNC) \
626 ((NPN_GetURLUPP) (FUNC))
627 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
628 (*(FUNC))((ARG1), (ARG2), (ARG3))
629 #endif
632 /* NPN_PostUrl */
634 #if _NPUPP_USE_UPP_
636 typedef UniversalProcPtr NPN_PostURLUPP;
637 enum {
638 uppNPN_PostURLProcInfo = kThinkCStackBased
639 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
640 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
641 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
642 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
643 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
644 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
645 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
647 #define NewNPN_PostURLProc(FUNC) \
648 (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
649 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
650 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
651 #else
653 typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
654 #define NewNPN_PostURLProc(FUNC) \
655 ((NPN_PostURLUPP) (FUNC))
656 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
657 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
658 #endif
661 /* NPN_RequestRead */
663 #if _NPUPP_USE_UPP_
665 typedef UniversalProcPtr NPN_RequestReadUPP;
666 enum {
667 uppNPN_RequestReadProcInfo = kThinkCStackBased
668 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
669 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
670 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
672 #define NewNPN_RequestReadProc(FUNC) \
673 (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
674 #define CallNPN_RequestReadProc(FUNC, stream, range) \
675 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
677 #else
679 typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
680 #define NewNPN_RequestReadProc(FUNC) \
681 ((NPN_RequestReadUPP) (FUNC))
682 #define CallNPN_RequestReadProc(FUNC, stream, range) \
683 (*(FUNC))((stream), (range))
685 #endif
688 /* NPN_NewStream */
690 #if _NPUPP_USE_UPP_
692 typedef UniversalProcPtr NPN_NewStreamUPP;
693 enum {
694 uppNPN_NewStreamProcInfo = kThinkCStackBased
695 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
696 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
697 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
698 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
699 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
701 #define NewNPN_NewStreamProc(FUNC) \
702 (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
703 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
704 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream))
706 #else
708 typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
709 #define NewNPN_NewStreamProc(FUNC) \
710 ((NPN_NewStreamUPP) (FUNC))
711 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
712 (*(FUNC))((npp), (type), (window), (stream))
714 #endif
717 /* NPN_Write */
719 #if _NPUPP_USE_UPP_
721 typedef UniversalProcPtr NPN_WriteUPP;
722 enum {
723 uppNPN_WriteProcInfo = kThinkCStackBased
724 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
725 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
726 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
727 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
728 | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
730 #define NewNPN_WriteProc(FUNC) \
731 (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
732 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
733 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))
735 #else
737 typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
738 #define NewNPN_WriteProc(FUNC) \
739 ((NPN_WriteUPP) (FUNC))
740 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
741 (*(FUNC))((npp), (stream), (len), (buffer))
743 #endif
746 /* NPN_DestroyStream */
748 #if _NPUPP_USE_UPP_
750 typedef UniversalProcPtr NPN_DestroyStreamUPP;
751 enum {
752 uppNPN_DestroyStreamProcInfo = kThinkCStackBased
753 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
754 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
755 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
756 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
758 #define NewNPN_DestroyStreamProc(FUNC) \
759 (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
760 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
761 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason))
763 #else
765 typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
766 #define NewNPN_DestroyStreamProc(FUNC) \
767 ((NPN_DestroyStreamUPP) (FUNC))
768 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
769 (*(FUNC))((npp), (stream), (reason))
771 #endif
774 /* NPN_Status */
776 #if _NPUPP_USE_UPP_
778 typedef UniversalProcPtr NPN_StatusUPP;
779 enum {
780 uppNPN_StatusProcInfo = kThinkCStackBased
781 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
782 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
785 #define NewNPN_StatusProc(FUNC) \
786 (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
787 #define CallNPN_StatusProc(FUNC, npp, msg) \
788 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))
790 #else
792 typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
793 #define NewNPN_StatusProc(FUNC) \
794 ((NPN_StatusUPP) (FUNC))
795 #define CallNPN_StatusProc(FUNC, npp, msg) \
796 (*(FUNC))((npp), (msg))
798 #endif
801 /* NPN_UserAgent */
802 #if _NPUPP_USE_UPP_
804 typedef UniversalProcPtr NPN_UserAgentUPP;
805 enum {
806 uppNPN_UserAgentProcInfo = kThinkCStackBased
807 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
808 | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
811 #define NewNPN_UserAgentProc(FUNC) \
812 (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture())
813 #define CallNPN_UserAgentProc(FUNC, ARG1) \
814 (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1))
816 #else
818 typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
819 #define NewNPN_UserAgentProc(FUNC) \
820 ((NPN_UserAgentUPP) (FUNC))
821 #define CallNPN_UserAgentProc(FUNC, ARG1) \
822 (*(FUNC))((ARG1))
824 #endif
827 /* NPN_MemAlloc */
828 #if _NPUPP_USE_UPP_
830 typedef UniversalProcPtr NPN_MemAllocUPP;
831 enum {
832 uppNPN_MemAllocProcInfo = kThinkCStackBased
833 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
834 | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
837 #define NewNPN_MemAllocProc(FUNC) \
838 (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
839 #define CallNPN_MemAllocProc(FUNC, ARG1) \
840 (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1))
842 #else
844 typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
845 #define NewNPN_MemAllocProc(FUNC) \
846 ((NPN_MemAllocUPP) (FUNC))
847 #define CallNPN_MemAllocProc(FUNC, ARG1) \
848 (*(FUNC))((ARG1))
850 #endif
853 /* NPN__MemFree */
855 #if _NPUPP_USE_UPP_
857 typedef UniversalProcPtr NPN_MemFreeUPP;
858 enum {
859 uppNPN_MemFreeProcInfo = kThinkCStackBased
860 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
863 #define NewNPN_MemFreeProc(FUNC) \
864 (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
865 #define CallNPN_MemFreeProc(FUNC, ARG1) \
866 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
868 #else
870 typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
871 #define NewNPN_MemFreeProc(FUNC) \
872 ((NPN_MemFreeUPP) (FUNC))
873 #define CallNPN_MemFreeProc(FUNC, ARG1) \
874 (*(FUNC))((ARG1))
876 #endif
879 /* NPN_MemFlush */
881 #if _NPUPP_USE_UPP_
883 typedef UniversalProcPtr NPN_MemFlushUPP;
884 enum {
885 uppNPN_MemFlushProcInfo = kThinkCStackBased
886 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
887 | RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
890 #define NewNPN_MemFlushProc(FUNC) \
891 (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
892 #define CallNPN_MemFlushProc(FUNC, ARG1) \
893 (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))
895 #else
897 typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
898 #define NewNPN_MemFlushProc(FUNC) \
899 ((NPN_MemFlushUPP) (FUNC))
900 #define CallNPN_MemFlushProc(FUNC, ARG1) \
901 (*(FUNC))((ARG1))
903 #endif
907 /* NPN_ReloadPlugins */
909 #if _NPUPP_USE_UPP_
911 typedef UniversalProcPtr NPN_ReloadPluginsUPP;
912 enum {
913 uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
914 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
915 | RESULT_SIZE(SIZE_CODE(0))
918 #define NewNPN_ReloadPluginsProc(FUNC) \
919 (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
920 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
921 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))
923 #else
925 typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
926 #define NewNPN_ReloadPluginsProc(FUNC) \
927 ((NPN_ReloadPluginsUPP) (FUNC))
928 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
929 (*(FUNC))((ARG1))
931 #endif
933 /* NPN_GetJavaEnv */
935 #if _NPUPP_USE_UPP_
937 typedef UniversalProcPtr NPN_GetJavaEnvUPP;
938 enum {
939 uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
940 | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
943 #define NewNPN_GetJavaEnvProc(FUNC) \
944 (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
945 #define CallNPN_GetJavaEnvProc(FUNC) \
946 (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo)
948 #else
949 typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
950 #define NewNPN_GetJavaEnvProc(FUNC) \
951 ((NPN_GetJavaEnvUPP) (FUNC))
952 #define CallNPN_GetJavaEnvProc(FUNC) \
953 (*(FUNC))()
955 #endif
958 /* NPN_GetJavaPeer */
960 #if _NPUPP_USE_UPP_
962 typedef UniversalProcPtr NPN_GetJavaPeerUPP;
963 enum {
964 uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
965 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
966 | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
969 #define NewNPN_GetJavaPeerProc(FUNC) \
970 (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
971 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
972 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1))
974 #else
976 typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
977 #define NewNPN_GetJavaPeerProc(FUNC) \
978 ((NPN_GetJavaPeerUPP) (FUNC))
979 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
980 (*(FUNC))((ARG1))
982 #endif
984 /* NPN_InvalidateRect */
986 #if _NPUPP_USE_UPP_
988 typedef UniversalProcPtr NPN_InvalidateRectUPP;
989 enum {
990 uppNPN_InvalidateRectProcInfo = kThinkCStackBased
991 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
992 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
993 | RESULT_SIZE(SIZE_CODE(0))
996 #define NewNPN_InvalidateRectProc(FUNC) \
997 (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
998 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
999 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))
1001 #else
1003 typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
1004 #define NewNPN_InvalidateRectProc(FUNC) \
1005 ((NPN_InvalidateRectUPP) (FUNC))
1006 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
1007 (*(FUNC))((ARG1), (ARG2))
1009 #endif
1012 /* NPN_InvalidateRegion */
1014 #if _NPUPP_USE_UPP_
1016 typedef UniversalProcPtr NPN_InvalidateRegionUPP;
1017 enum {
1018 uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
1019 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1020 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
1021 | RESULT_SIZE(SIZE_CODE(0))
1024 #define NewNPN_InvalidateRegionProc(FUNC) \
1025 (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
1026 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
1027 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))
1029 #else
1031 typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
1032 #define NewNPN_InvalidateRegionProc(FUNC) \
1033 ((NPN_InvalidateRegionUPP) (FUNC))
1034 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
1035 (*(FUNC))((ARG1), (ARG2))
1037 #endif
1039 /* NPN_ForceRedraw */
1041 #if _NPUPP_USE_UPP_
1043 typedef UniversalProcPtr NPN_ForceRedrawUPP;
1044 enum {
1045 uppNPN_ForceRedrawProcInfo = kThinkCStackBased
1046 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1047 | RESULT_SIZE(SIZE_CODE(sizeof(0)))
1050 #define NewNPN_ForceRedrawProc(FUNC) \
1051 (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
1052 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \
1053 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1))
1055 #else
1057 typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance);
1058 #define NewNPN_ForceRedrawProc(FUNC) \
1059 ((NPN_ForceRedrawUPP) (FUNC))
1060 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \
1061 (*(FUNC))((ARG1))
1063 #endif
1065 /* NPN_GetStringIdentifier */
1067 #if _NPUPP_USE_UPP_
1069 typedef UniversalProcPtr NPN_GetStringIdentifierUPP;
1070 enum {
1071 uppNPN_GetStringIdentifierProcInfo = kThinkCStackBased
1072 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8*)))
1073 | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
1076 #define NewNPN_GetStringIdentifierProc(FUNC) \
1077 (NPN_GetStringIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, GetCurrentArchitecture())
1078 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \
1079 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, (ARG1))
1081 #else
1083 typedef NPIdentifier (* NP_LOADDS NPN_GetStringIdentifierUPP)(const NPUTF8* name);
1084 #define NewNPN_GetStringIdentifierProc(FUNC) \
1085 ((NPN_GetStringIdentifierUPP) (FUNC))
1086 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \
1087 (*(FUNC))((ARG1))
1089 #endif
1091 /* NPN_GetStringIdentifiers */
1093 #if _NPUPP_USE_UPP_
1095 typedef UniversalProcPtr NPN_GetStringIdentifiersUPP;
1096 enum {
1097 uppNPN_GetStringIdentifiersProcInfo = kThinkCStackBased
1098 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8**)))
1099 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32_t)))
1100 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier*)))
1101 | RESULT_SIZE(SIZE_CODE(0))
1104 #define NewNPN_GetStringIdentifiersProc(FUNC) \
1105 (NPN_GetStringIdentifiersUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, GetCurrentArchitecture())
1106 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3) \
1107 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, (ARG1), (ARG2), (ARG3))
1109 #else
1111 typedef void (* NP_LOADDS NPN_GetStringIdentifiersUPP)(const NPUTF8** names,
1112 int32_t nameCount,
1113 NPIdentifier* identifiers);
1114 #define NewNPN_GetStringIdentifiersProc(FUNC) \
1115 ((NPN_GetStringIdentifiersUPP) (FUNC))
1116 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3) \
1117 (*(FUNC))((ARG1), (ARG2), (ARG3))
1119 #endif
1121 /* NPN_GetIntIdentifier */
1123 #if _NPUPP_USE_UPP_
1125 typedef UniversalProcPtr NPN_GetIntIdentifierUPP;
1126 enum {
1127 uppNPN_GetIntIdentifierProcInfo = kThinkCStackBased
1128 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32_t)))
1129 | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
1132 #define NewNPN_GetIntIdentifierProc(FUNC) \
1133 (NPN_GetIntIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, GetCurrentArchitecture())
1134 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \
1135 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, (ARG1))
1137 #else
1139 typedef NPIdentifier (* NP_LOADDS NPN_GetIntIdentifierUPP)(int32_t intid);
1140 #define NewNPN_GetIntIdentifierProc(FUNC) \
1141 ((NPN_GetIntIdentifierUPP) (FUNC))
1142 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \
1143 (*(FUNC))((ARG1))
1145 #endif
1147 /* NPN_IdentifierIsString */
1149 #if _NPUPP_USE_UPP_
1151 typedef UniversalProcPtr NPN_IdentifierIsStringUPP;
1152 enum {
1153 uppNPN_IdentifierIsStringProcInfo = kThinkCStackBased
1154 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier identifier)))
1155 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1158 #define NewNPN_IdentifierIsStringProc(FUNC) \
1159 (NPN_IdentifierIsStringUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, GetCurrentArchitecture())
1160 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \
1161 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, (ARG1))
1163 #else
1165 typedef bool (* NP_LOADDS NPN_IdentifierIsStringUPP)(NPIdentifier identifier);
1166 #define NewNPN_IdentifierIsStringProc(FUNC) \
1167 ((NPN_IdentifierIsStringUPP) (FUNC))
1168 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \
1169 (*(FUNC))((ARG1))
1171 #endif
1173 /* NPN_UTF8FromIdentifier */
1175 #if _NPUPP_USE_UPP_
1177 typedef UniversalProcPtr NPN_UTF8FromIdentifierUPP;
1178 enum {
1179 uppNPN_UTF8FromIdentifierProcInfo = kThinkCStackBased
1180 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
1181 | RESULT_SIZE(SIZE_CODE(sizeof(NPUTF8*)))
1184 #define NewNPN_UTF8FromIdentifierProc(FUNC) \
1185 (NPN_UTF8FromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, GetCurrentArchitecture())
1186 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \
1187 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, (ARG1))
1189 #else
1191 typedef NPUTF8* (* NP_LOADDS NPN_UTF8FromIdentifierUPP)(NPIdentifier identifier);
1192 #define NewNPN_UTF8FromIdentifierProc(FUNC) \
1193 ((NPN_UTF8FromIdentifierUPP) (FUNC))
1194 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \
1195 (*(FUNC))((ARG1))
1197 #endif
1199 /* NPN_IntFromIdentifier */
1201 #if _NPUPP_USE_UPP_
1203 typedef UniversalProcPtr NPN_IntFromIdentifierUPP;
1204 enum {
1205 uppNPN_IntFromIdentifierProcInfo = kThinkCStackBased
1206 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
1207 | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
1210 #define NewNPN_IntFromIdentifierProc(FUNC) \
1211 (NPN_IntFromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, GetCurrentArchitecture())
1212 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \
1213 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, (ARG1))
1215 #else
1217 typedef int32_t (* NP_LOADDS NPN_IntFromIdentifierUPP)(NPIdentifier identifier);
1218 #define NewNPN_IntFromIdentifierProc(FUNC) \
1219 ((NPN_IntFromIdentifierUPP) (FUNC))
1220 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \
1221 (*(FUNC))((ARG1))
1223 #endif
1225 /* NPN_CreateObject */
1227 #if _NPUPP_USE_UPP_
1229 typedef UniversalProcPtr NPN_CreateObjectUPP;
1230 enum {
1231 uppNPN_CreateObjectProcInfo = kThinkCStackBased
1232 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1233 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPClass*)))
1234 | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
1237 #define NewNPN_CreateObjectProc(FUNC) \
1238 (NPN_CreateObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, GetCurrentArchitecture())
1239 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \
1240 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, (ARG1), (ARG2))
1242 #else
1244 typedef NPObject* (* NP_LOADDS NPN_CreateObjectUPP)(NPP npp, NPClass *aClass);
1245 #define NewNPN_CreateObjectProc(FUNC) \
1246 ((NPN_CreateObjectUPP) (FUNC))
1247 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \
1248 (*(FUNC))((ARG1), (ARG2))
1250 #endif
1252 /* NPN_RetainObject */
1254 #if _NPUPP_USE_UPP_
1256 typedef UniversalProcPtr NPN_RetainObjectUPP;
1257 enum {
1258 uppNPN_RetainObjectProcInfo = kThinkCStackBased
1259 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
1260 | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
1263 #define NewNPN_RetainObjectProc(FUNC) \
1264 (NPN_RetainObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, GetCurrentArchitecture())
1265 #define CallNPN_RetainObjectProc(FUNC, ARG1) \
1266 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, (ARG1))
1268 #else
1270 typedef NPObject* (* NP_LOADDS NPN_RetainObjectUPP)(NPObject *obj);
1271 #define NewNPN_RetainObjectProc(FUNC) \
1272 ((NPN_RetainObjectUPP) (FUNC))
1273 #define CallNPN_RetainObjectProc(FUNC, ARG1) \
1274 (*(FUNC))((ARG1))
1276 #endif
1278 /* NPN_ReleaseObject */
1280 #if _NPUPP_USE_UPP_
1282 typedef UniversalProcPtr NPN_ReleaseObjectUPP;
1283 enum {
1284 uppNPN_ReleaseObjectProcInfo = kThinkCStackBased
1285 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
1286 | RESULT_SIZE(SIZE_CODE(0))
1289 #define NewNPN_ReleaseObjectProc(FUNC) \
1290 (NPN_ReleaseObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, GetCurrentArchitecture())
1291 #define CallNPN_ReleaseObjectProc(FUNC, ARG1) \
1292 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, (ARG1))
1294 #else
1296 typedef void (* NP_LOADDS NPN_ReleaseObjectUPP)(NPObject *obj);
1297 #define NewNPN_ReleaseObjectProc(FUNC) \
1298 ((NPN_ReleaseObjectUPP) (FUNC))
1299 #define CallNPN_ReleaseObjectProc(FUNC, ARG1) \
1300 (*(FUNC))((ARG1))
1302 #endif
1304 /* NPN_Invoke */
1306 #if _NPUPP_USE_UPP_
1308 typedef UniversalProcPtr NPN_InvokeUPP;
1309 enum {
1310 uppNPN_InvokeProcInfo = kThinkCStackBased
1311 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1312 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1313 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1314 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
1315 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(quint32)))
1316 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
1317 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1320 #define NewNPN_InvokeProc(FUNC) \
1321 (NPN_InvokeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeProcInfo, GetCurrentArchitecture())
1322 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
1323 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
1325 #else
1327 typedef bool (* NP_LOADDS NPN_InvokeUPP)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, quint32 argCount, NPVariant *result);
1328 #define NewNPN_InvokeProc(FUNC) \
1329 ((NPN_InvokeUPP) (FUNC))
1330 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
1331 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
1333 #endif
1335 /* NPN_InvokeDefault */
1337 #if _NPUPP_USE_UPP_
1339 typedef UniversalProcPtr NPN_InvokeDefaultUPP;
1340 enum {
1341 uppNPN_InvokeDefaultProcInfo = kThinkCStackBased
1342 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1343 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1344 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
1345 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(quint32)))
1346 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
1347 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1350 #define NewNPN_InvokeDefaultProc(FUNC) \
1351 (NPN_InvokeDefaultUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, GetCurrentArchitecture())
1352 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
1353 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
1355 #else
1357 typedef bool (* NP_LOADDS NPN_InvokeDefaultUPP)(NPP npp, NPObject* obj, const NPVariant *args, quint32 argCount, NPVariant *result);
1358 #define NewNPN_InvokeDefaultProc(FUNC) \
1359 ((NPN_InvokeDefaultUPP) (FUNC))
1360 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
1361 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
1363 #endif
1365 /* NPN_Evaluate */
1367 #if _NPUPP_USE_UPP_
1369 typedef UniversalProcPtr NPN_EvaluateUPP;
1370 enum {
1371 uppNPN_EvaluateProcInfo = kThinkCStackBased
1372 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1373 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1374 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPString*)))
1375 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
1376 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1379 #define NewNPN_EvaluateProc(FUNC) \
1380 (NPN_EvaluateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_EvaluateProcInfo, GetCurrentArchitecture())
1381 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1382 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_EvaluateProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
1384 #else
1386 typedef bool (* NP_LOADDS NPN_EvaluateUPP)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
1387 #define NewNPN_EvaluateProc(FUNC) \
1388 ((NPN_EvaluateUPP) (FUNC))
1389 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1390 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
1392 #endif
1394 /* NPN_GetProperty */
1396 #if _NPUPP_USE_UPP_
1398 typedef UniversalProcPtr NPN_GetPropertyUPP;
1399 enum {
1400 uppNPN_GetPropertyProcInfo = kThinkCStackBased
1401 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1402 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1403 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1404 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
1405 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1408 #define NewNPN_GetPropertyProc(FUNC) \
1409 (NPN_GetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, GetCurrentArchitecture())
1410 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1411 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
1413 #else
1415 typedef bool (* NP_LOADDS NPN_GetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
1416 #define NewNPN_GetPropertyProc(FUNC) \
1417 ((NPN_GetPropertyUPP) (FUNC))
1418 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1419 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
1421 #endif
1423 /* NPN_SetProperty */
1425 #if _NPUPP_USE_UPP_
1427 typedef UniversalProcPtr NPN_SetPropertyUPP;
1428 enum {
1429 uppNPN_SetPropertyProcInfo = kThinkCStackBased
1430 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1431 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1432 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1433 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
1434 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1437 #define NewNPN_SetPropertyProc(FUNC) \
1438 (NPN_SetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, GetCurrentArchitecture())
1439 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1440 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
1442 #else
1444 typedef bool (* NP_LOADDS NPN_SetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
1445 #define NewNPN_SetPropertyProc(FUNC) \
1446 ((NPN_SetPropertyUPP) (FUNC))
1447 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
1448 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
1450 #endif
1452 /* NPN_RemoveProperty */
1454 #if _NPUPP_USE_UPP_
1456 typedef UniversalProcPtr NPN_RemovePropertyUPP;
1457 enum {
1458 uppNPN_RemovePropertyProcInfo = kThinkCStackBased
1459 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1460 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1461 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1462 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1465 #define NewNPN_RemovePropertyProc(FUNC) \
1466 (NPN_RemovePropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, GetCurrentArchitecture())
1467 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \
1468 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, (ARG1), (ARG2), (ARG3))
1470 #else
1472 typedef bool (* NP_LOADDS NPN_RemovePropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
1473 #define NewNPN_RemovePropertyProc(FUNC) \
1474 ((NPN_RemovePropertyUPP) (FUNC))
1475 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \
1476 (*(FUNC))((ARG1), (ARG2), (ARG3))
1478 #endif
1480 /* NPN_HasProperty */
1482 #if _NPUPP_USE_UPP_
1484 typedef UniversalProcPtr NPN_HasPropertyUPP;
1485 enum {
1486 uppNPN_HasPropertyProcInfo = kThinkCStackBased
1487 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1488 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1489 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1490 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1493 #define NewNPN_HasPropertyProc(FUNC) \
1494 (NPN_HasPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, GetCurrentArchitecture())
1495 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \
1496 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, (ARG1), (ARG2), (ARG3))
1498 #else
1500 typedef bool (* NP_LOADDS NPN_HasPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
1501 #define NewNPN_HasPropertyProc(FUNC) \
1502 ((NPN_HasPropertyUPP) (FUNC))
1503 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \
1504 (*(FUNC))((ARG1), (ARG2), (ARG3))
1506 #endif
1508 /* NPN_HasMethod */
1510 #if _NPUPP_USE_UPP_
1512 typedef UniversalProcPtr NPN_HasMethodUPP;
1513 enum {
1514 uppNPN_HasMethodProcInfo = kThinkCStackBased
1515 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1516 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
1517 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
1518 | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
1521 #define NewNPN_HasMethodProc(FUNC) \
1522 (NPN_HasMethodUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasMethodProcInfo, GetCurrentArchitecture())
1523 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \
1524 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasMethodProcInfo, (ARG1), (ARG2), (ARG3))
1526 #else
1528 typedef bool (* NP_LOADDS NPN_HasMethodUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
1529 #define NewNPN_HasMethodProc(FUNC) \
1530 ((NPN_HasMethodUPP) (FUNC))
1531 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \
1532 (*(FUNC))((ARG1), (ARG2), (ARG3))
1534 #endif
1536 /* NPN_ReleaseVariantValue */
1538 #if _NPUPP_USE_UPP_
1540 typedef UniversalProcPtr NPN_ReleaseVariantValue;
1541 enum {
1542 uppNPN_ReleaseVariantValueProcInfo = kThinkCStackBased
1543 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPVariant*)))
1544 | RESULT_SIZE(SIZE_CODE(0))
1547 #define NewNPN_ReleaseVariantValueProc(FUNC) \
1548 (NPN_ReleaseVariantValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, GetCurrentArchitecture())
1549 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \
1550 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, (ARG1))
1552 #else
1554 typedef void (* NP_LOADDS NPN_ReleaseVariantValueUPP)(NPVariant *variant);
1555 #define NewNPN_ReleaseVariantValueProc(FUNC) \
1556 ((NPN_ReleaseVariantValueUPP) (FUNC))
1557 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \
1558 (*(FUNC))((ARG1))
1560 #endif
1562 /* NPN_SetException */
1564 #if _NPUPP_USE_UPP_
1566 typedef UniversalProcPtr NPN_SetExceptionUPP;
1567 enum {
1568 uppNPN_SetExceptionProcInfo = kThinkCStackBased
1569 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
1570 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const NPUTF8*)))
1571 | RESULT_SIZE(SIZE_CODE(0))
1574 #define NewNPN_SetExceptionProc(FUNC) \
1575 (NPN_SetExceptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, GetCurrentArchitecture())
1576 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \
1577 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, (ARG1), (ARG2))
1579 #else
1581 typedef void (* NP_LOADDS NPN_SetExceptionUPP)(NPObject *obj, const NPUTF8 *message);
1582 #define NewNPN_SetExceptionProc(FUNC) \
1583 ((NPN_SetExceptionUPP) (FUNC))
1584 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \
1585 (*(FUNC))((ARG1), (ARG2))
1587 #endif
1589 /* NPN_PushPopupsEnabledStateUPP */
1591 #if _NPUPP_USE_UPP_
1593 typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP;
1594 enum {
1595 uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased
1596 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1597 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool)))
1598 | RESULT_SIZE(SIZE_CODE(0))
1601 #define NewNPN_PushPopupsEnabledStateProc(FUNC) \
1602 (NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture())
1603 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \
1604 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, (ARG1), (ARG2))
1606 #else
1608 typedef void (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled);
1609 #define NewNPN_PushPopupsEnabledStateProc(FUNC) \
1610 ((NPN_PushPopupsEnabledStateUPP) (FUNC))
1611 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \
1612 (*(FUNC))((ARG1), (ARG2))
1614 #endif
1616 /* NPN_PopPopupsEnabledState */
1618 #if _NPUPP_USE_UPP_
1620 typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP;
1621 enum {
1622 uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased
1623 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
1624 | RESULT_SIZE(SIZE_CODE(0))
1627 #define NewNPN_PopPopupsEnabledStateProc(FUNC) \
1628 (NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture())
1629 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \
1630 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, (ARG1))
1632 #else
1634 typedef void (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp);
1635 #define NewNPN_PopPopupsEnabledStateProc(FUNC) \
1636 ((NPN_PopPopupsEnabledStateUPP) (FUNC))
1637 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \
1638 (*(FUNC))((ARG1))
1640 #endif
1644 /******************************************************************************************
1645 * The actual plugin function table definitions
1646 *******************************************************************************************/
1648 #ifdef XP_MAC
1649 #if PRAGMA_STRUCT_ALIGN
1650 #pragma options align=mac68k
1651 #endif
1652 #endif
1654 typedef struct _NPPluginFuncs {
1655 uint16 size;
1656 uint16 version;
1657 NPP_NewUPP newp;
1658 NPP_DestroyUPP destroy;
1659 NPP_SetWindowUPP setwindow;
1660 NPP_NewStreamUPP newstream;
1661 NPP_DestroyStreamUPP destroystream;
1662 NPP_StreamAsFileUPP asfile;
1663 NPP_WriteReadyUPP writeready;
1664 NPP_WriteUPP write;
1665 NPP_PrintUPP print;
1666 NPP_HandleEventUPP event;
1667 NPP_URLNotifyUPP urlnotify;
1668 JRIGlobalRef javaClass;
1669 NPP_GetValueUPP getvalue;
1670 NPP_SetValueUPP setvalue;
1671 } NPPluginFuncs;
1673 typedef struct _NPNetscapeFuncs {
1674 uint16 size;
1675 uint16 version;
1676 NPN_GetURLUPP geturl;
1677 NPN_PostURLUPP posturl;
1678 NPN_RequestReadUPP requestread;
1679 NPN_NewStreamUPP newstream;
1680 NPN_WriteUPP write;
1681 NPN_DestroyStreamUPP destroystream;
1682 NPN_StatusUPP status;
1683 NPN_UserAgentUPP uagent;
1684 NPN_MemAllocUPP memalloc;
1685 NPN_MemFreeUPP memfree;
1686 NPN_MemFlushUPP memflush;
1687 NPN_ReloadPluginsUPP reloadplugins;
1688 NPN_GetJavaEnvUPP getJavaEnv;
1689 NPN_GetJavaPeerUPP getJavaPeer;
1690 NPN_GetURLNotifyUPP geturlnotify;
1691 NPN_PostURLNotifyUPP posturlnotify;
1692 NPN_GetValueUPP getvalue;
1693 NPN_SetValueUPP setvalue;
1694 NPN_InvalidateRectUPP invalidaterect;
1695 NPN_InvalidateRegionUPP invalidateregion;
1696 NPN_ForceRedrawUPP forceredraw;
1697 NPN_GetStringIdentifierUPP getstringidentifier;
1698 NPN_GetStringIdentifiersUPP getstringidentifiers;
1699 NPN_GetIntIdentifierUPP getintidentifier;
1700 NPN_IdentifierIsStringUPP identifierisstring;
1701 NPN_UTF8FromIdentifierUPP utf8fromidentifier;
1702 NPN_IntFromIdentifierUPP intfromidentifier;
1703 NPN_CreateObjectUPP createobject;
1704 NPN_RetainObjectUPP retainobject;
1705 NPN_ReleaseObjectUPP releaseobject;
1706 NPN_InvokeUPP invoke;
1707 NPN_InvokeDefaultUPP invokeDefault;
1708 NPN_EvaluateUPP evaluate;
1709 NPN_GetPropertyUPP getproperty;
1710 NPN_SetPropertyUPP setproperty;
1711 NPN_RemovePropertyUPP removeproperty;
1712 NPN_HasPropertyUPP hasproperty;
1713 NPN_HasMethodUPP hasmethod;
1714 NPN_ReleaseVariantValueUPP releasevariantvalue;
1715 NPN_SetExceptionUPP setexception;
1716 NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
1717 NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
1718 } NPNetscapeFuncs;
1720 #ifdef XP_MAC
1721 #if PRAGMA_STRUCT_ALIGN
1722 #pragma options align=reset
1723 #endif
1724 #endif
1727 #if defined(XP_MAC) || defined(XP_MACOSX)
1728 /******************************************************************************************
1729 * Mac platform-specific plugin glue stuff
1730 *******************************************************************************************/
1733 * Main entry point of the plugin.
1734 * This routine will be called when the plugin is loaded. The function
1735 * tables are passed in and the plugin fills in the NPPluginFuncs table
1736 * and NPPShutdownUPP for Netscape's use.
1739 #if _NPUPP_USE_UPP_
1741 typedef UniversalProcPtr NPP_MainEntryUPP;
1742 enum {
1743 uppNPP_MainEntryProcInfo = kThinkCStackBased
1744 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
1745 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
1746 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
1747 | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
1749 #define NewNPP_MainEntryProc(FUNC) \
1750 (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
1751 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
1752 CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
1754 #else
1756 typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
1757 #define NewNPP_MainEntryProc(FUNC) \
1758 ((NPP_MainEntryUPP) (FUNC))
1759 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
1760 (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
1762 #endif
1766 * Mac version(s) of NP_GetMIMEDescription(const char *)
1767 * These can be called to retrieve MIME information from the plugin dynamically
1769 * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
1770 * to get mime info from the plugin only on OSX and may not be supported
1771 * in furture version--use NP_GetMIMEDescription instead
1774 enum
1776 kBPSupportedMIMETypesStructVers_1 = 1
1779 typedef struct _BPSupportedMIMETypes
1781 SInt32 structVersion; /* struct version */
1782 Handle typeStrings; /* STR# formated handle, allocated by plug-in */
1783 Handle infoStrings; /* STR# formated handle, allocated by plug-in */
1784 } BPSupportedMIMETypes;
1785 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
1787 #if _NPUPP_USE_UPP_
1789 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD"
1790 typedef UniversalProcPtr NP_GetMIMEDescriptionUPP;
1791 enum {
1792 uppNP_GetMIMEDescEntryProc = kThinkCStackBased
1793 | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
1795 #define NewNP_GetMIMEDescEntryProc(FUNC) \
1796 (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture())
1797 #define CallNP_GetMIMEDescEntryProc(FUNC) \
1798 (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc)
1801 #else /* !_NPUPP_USE_UPP_ */
1803 /* NP_GetMIMEDescription */
1804 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
1805 typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
1806 #define NewNP_GetMIMEDescEntryProc(FUNC) \
1807 ((NP_GetMIMEDescriptionUPP) (FUNC))
1808 #define CallNP_GetMIMEDescEntryProc(FUNC) \
1809 (*(FUNC))()
1810 /* BP_GetSupportedMIMETypes */
1811 typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32);
1812 #define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \
1813 ((BP_GetSupportedMIMETypesUPP) (FUNC))
1814 #define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \
1815 (*(FUNC))((mimeInfo), (flags))
1817 #endif
1818 #endif /* MAC */
1820 #if defined(_WINDOWS)
1821 #define OSCALL WINAPI
1822 #else
1823 #if defined(__OS2__)
1824 #define OSCALL _System
1825 #else
1826 #define OSCALL
1827 #endif
1828 #endif
1830 #if defined( _WINDOWS ) || defined (__OS2__)
1832 #ifdef __cplusplus
1833 extern "C" {
1834 #endif
1836 /* plugin meta member functions */
1837 #if defined(__OS2__)
1839 typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */
1840 char *pMimeTypes;
1841 char *pFileExtents;
1842 char *pFileOpenTemplate;
1843 char *pProductName;
1844 char *pProductDescription;
1845 unsigned long dwProductVersionMS;
1846 unsigned long dwProductVersionLS;
1847 } NPPluginData;
1849 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
1851 #endif
1853 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
1855 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs);
1857 NPError OSCALL NP_Shutdown();
1859 char* NP_GetMIMEDescription();
1861 #ifdef __cplusplus
1863 #endif
1865 #endif /* _WINDOWS || __OS2__ */
1867 #if defined(__OS2__)
1868 #pragma pack()
1869 #endif
1871 #ifdef XP_UNIX
1873 #ifdef __cplusplus
1874 extern "C" {
1875 #endif
1877 /* plugin meta member functions */
1879 char* NP_GetMIMEDescription(void);
1880 NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
1881 NPError NP_Shutdown(void);
1882 NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
1884 #ifdef __cplusplus
1886 #endif
1888 #endif /* XP_UNIX */
1890 #endif /* _NPUPP_H_ */