|
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* ***** BEGIN LICENSE BLOCK ***** |
|
3 * Version: NPL 1.1/GPL 2.0/LGPL 2.1 |
|
4 * |
|
5 * The contents of this file are subject to the Netscape Public License |
|
6 * Version 1.1 (the "License"); you may not use this file except in |
|
7 * compliance with the License. You may obtain a copy of the License at |
|
8 * http://www.mozilla.org/NPL/ |
|
9 * |
|
10 * Software distributed under the License is distributed on an "AS IS" basis, |
|
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
|
12 * for the specific language governing rights and limitations under the |
|
13 * License. |
|
14 * |
|
15 * The Original Code is mozilla.org code. |
|
16 * |
|
17 * The Initial Developer of the Original Code is |
|
18 * Netscape Communications Corporation. |
|
19 * Portions created by the Initial Developer are Copyright (C) 1998 |
|
20 * the Initial Developer. All Rights Reserved. |
|
21 * |
|
22 * Contributor(s): |
|
23 * Portions Copyright (c) 2004-2006, Nokia Corporation |
|
24 * |
|
25 * |
|
26 * Alternatively, the contents of this file may be used under the terms of |
|
27 * either the GNU General Public License Version 2 or later (the "GPL"), or |
|
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
|
29 * in which case the provisions of the GPL or the LGPL are applicable instead |
|
30 * of those above. If you wish to allow use of your version of this file only |
|
31 * under the terms of either the GPL or the LGPL, and not to allow others to |
|
32 * use your version of this file under the terms of the NPL, indicate your |
|
33 * decision by deleting the provisions above and replace them with the notice |
|
34 * and other provisions required by the GPL or the LGPL. If you do not delete |
|
35 * the provisions above, a recipient may use your version of this file under |
|
36 * the terms of any one of the NPL, the GPL or the LGPL. |
|
37 * |
|
38 * ***** END LICENSE BLOCK ***** */ |
|
39 |
|
40 /* NOTES: |
|
41 * Nokia modified this file, by changing certain variables for the purpose of |
|
42 * porting the file to the Symbian platform on May 1st, 2004. |
|
43 */ |
|
44 |
|
45 |
|
46 /* |
|
47 * npupp.h $Revision: 3.15 $ |
|
48 * function call mecahnics needed by platform specific glue code. |
|
49 */ |
|
50 |
|
51 |
|
52 #ifndef _NPUPP_H_ |
|
53 #define _NPUPP_H_ |
|
54 |
|
55 #if defined(__OS2__) |
|
56 #pragma pack(1) |
|
57 #endif |
|
58 |
|
59 #ifndef GENERATINGCFM |
|
60 #define GENERATINGCFM 0 |
|
61 #endif |
|
62 |
|
63 #ifndef _NPAPI_H_ |
|
64 #include "npapi.h" |
|
65 #endif |
|
66 |
|
67 #include "jri.h" |
|
68 |
|
69 /****************************************************************************************** |
|
70 plug-in function table macros |
|
71 for each function in and out of the plugin API we define |
|
72 typedef NPP_FooUPP |
|
73 #define NewNPP_FooProc |
|
74 #define CallNPP_FooProc |
|
75 for mac, define the UPP magic for PPC/68K calling |
|
76 *******************************************************************************************/ |
|
77 |
|
78 |
|
79 /* NPP_Initialize */ |
|
80 |
|
81 #define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON) |
|
82 |
|
83 #if _NPUPP_USE_UPP_ |
|
84 typedef UniversalProcPtr NPP_InitializeUPP; |
|
85 |
|
86 enum { |
|
87 uppNPP_InitializeProcInfo = kThinkCStackBased |
|
88 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) |
|
89 | RESULT_SIZE(SIZE_CODE(0)) |
|
90 }; |
|
91 |
|
92 #define NewNPP_InitializeProc(FUNC) \ |
|
93 (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture()) |
|
94 #define CallNPP_InitializeProc(FUNC) \ |
|
95 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo) |
|
96 |
|
97 #else |
|
98 |
|
99 typedef void (* NP_LOADDS NPP_InitializeUPP)(void); |
|
100 #define NewNPP_InitializeProc(FUNC) \ |
|
101 ((NPP_InitializeUPP) (FUNC)) |
|
102 #define CallNPP_InitializeProc(FUNC) \ |
|
103 (*(FUNC))() |
|
104 |
|
105 #endif |
|
106 |
|
107 |
|
108 /* NPP_Shutdown */ |
|
109 |
|
110 #if _NPUPP_USE_UPP_ |
|
111 typedef UniversalProcPtr NPP_ShutdownUPP; |
|
112 |
|
113 enum { |
|
114 uppNPP_ShutdownProcInfo = kThinkCStackBased |
|
115 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) |
|
116 | RESULT_SIZE(SIZE_CODE(0)) |
|
117 }; |
|
118 |
|
119 #define NewNPP_ShutdownProc(FUNC) \ |
|
120 (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture()) |
|
121 #define CallNPP_ShutdownProc(FUNC) \ |
|
122 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo) |
|
123 |
|
124 #else |
|
125 |
|
126 typedef void (* NP_LOADDS NPP_ShutdownUPP)(void); |
|
127 #define NewNPP_ShutdownProc(FUNC) \ |
|
128 ((NPP_ShutdownUPP) (FUNC)) |
|
129 #define CallNPP_ShutdownProc(FUNC) \ |
|
130 (*(FUNC))() |
|
131 |
|
132 #endif |
|
133 |
|
134 |
|
135 /* NPP_New */ |
|
136 |
|
137 #if _NPUPP_USE_UPP_ |
|
138 typedef UniversalProcPtr NPP_NewUPP; |
|
139 |
|
140 enum { |
|
141 uppNPP_NewProcInfo = kThinkCStackBased |
|
142 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) |
|
143 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) |
|
144 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) |
|
145 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) |
|
146 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) |
|
147 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) |
|
148 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) |
|
149 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
150 }; |
|
151 |
|
152 #define NewNPP_NewProc(FUNC) \ |
|
153 (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture()) |
|
154 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ |
|
155 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \ |
|
156 (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
|
157 #else |
|
158 #ifndef __SYMBIAN32__ |
|
159 typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); |
|
160 #define NewNPP_NewProc(FUNC) \ |
|
161 ((NPP_NewUPP) (FUNC)) |
|
162 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ |
|
163 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
|
164 #else/* __SYMBIAN32__ */ |
|
165 typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, |
|
166 uint16 mode, CDesCArray* argn, |
|
167 CDesCArray* argv, NPSavedData* saved); |
|
168 #define NewNPP_NewProc(FUNC) \ |
|
169 ((NPP_NewUPP) (FUNC)) |
|
170 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
|
171 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
|
172 #endif /* __SYMBIAN32__ */ |
|
173 |
|
174 |
|
175 #endif |
|
176 |
|
177 |
|
178 /* NPP_Destroy */ |
|
179 |
|
180 #if _NPUPP_USE_UPP_ |
|
181 |
|
182 typedef UniversalProcPtr NPP_DestroyUPP; |
|
183 enum { |
|
184 uppNPP_DestroyProcInfo = kThinkCStackBased |
|
185 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
186 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) |
|
187 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
188 }; |
|
189 #define NewNPP_DestroyProc(FUNC) \ |
|
190 (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture()) |
|
191 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ |
|
192 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2)) |
|
193 #else |
|
194 |
|
195 typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save); |
|
196 #define NewNPP_DestroyProc(FUNC) \ |
|
197 ((NPP_DestroyUPP) (FUNC)) |
|
198 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ |
|
199 (*(FUNC))((ARG1), (ARG2)) |
|
200 |
|
201 #endif |
|
202 |
|
203 |
|
204 /* NPP_SetWindow */ |
|
205 |
|
206 #if _NPUPP_USE_UPP_ |
|
207 |
|
208 typedef UniversalProcPtr NPP_SetWindowUPP; |
|
209 enum { |
|
210 uppNPP_SetWindowProcInfo = kThinkCStackBased |
|
211 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
212 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) |
|
213 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
214 }; |
|
215 #define NewNPP_SetWindowProc(FUNC) \ |
|
216 (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture()) |
|
217 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ |
|
218 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2)) |
|
219 |
|
220 #else |
|
221 |
|
222 typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window); |
|
223 #define NewNPP_SetWindowProc(FUNC) \ |
|
224 ((NPP_SetWindowUPP) (FUNC)) |
|
225 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ |
|
226 (*(FUNC))((ARG1), (ARG2)) |
|
227 |
|
228 #endif |
|
229 |
|
230 |
|
231 /* NPP_NewStream */ |
|
232 |
|
233 #if _NPUPP_USE_UPP_ |
|
234 |
|
235 typedef UniversalProcPtr NPP_NewStreamUPP; |
|
236 enum { |
|
237 uppNPP_NewStreamProcInfo = kThinkCStackBased |
|
238 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
239 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) |
|
240 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) |
|
241 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) |
|
242 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) |
|
243 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
244 }; |
|
245 #define NewNPP_NewStreamProc(FUNC) \ |
|
246 (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture()) |
|
247 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ |
|
248 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
|
249 #else |
|
250 |
|
251 typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); |
|
252 #define NewNPP_NewStreamProc(FUNC) \ |
|
253 ((NPP_NewStreamUPP) (FUNC)) |
|
254 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ |
|
255 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
|
256 #endif |
|
257 |
|
258 |
|
259 /* NPP_DestroyStream */ |
|
260 |
|
261 #if _NPUPP_USE_UPP_ |
|
262 |
|
263 typedef UniversalProcPtr NPP_DestroyStreamUPP; |
|
264 enum { |
|
265 uppNPP_DestroyStreamProcInfo = kThinkCStackBased |
|
266 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
267 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
268 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
|
269 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
270 }; |
|
271 #define NewNPP_DestroyStreamProc(FUNC) \ |
|
272 (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture()) |
|
273 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ |
|
274 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) |
|
275 |
|
276 #else |
|
277 |
|
278 typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); |
|
279 #define NewNPP_DestroyStreamProc(FUNC) \ |
|
280 ((NPP_DestroyStreamUPP) (FUNC)) |
|
281 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ |
|
282 (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) |
|
283 |
|
284 #endif |
|
285 |
|
286 |
|
287 /* NPP_WriteReady */ |
|
288 |
|
289 #if _NPUPP_USE_UPP_ |
|
290 |
|
291 typedef UniversalProcPtr NPP_WriteReadyUPP; |
|
292 enum { |
|
293 uppNPP_WriteReadyProcInfo = kThinkCStackBased |
|
294 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
295 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
296 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
|
297 }; |
|
298 #define NewNPP_WriteReadyProc(FUNC) \ |
|
299 (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture()) |
|
300 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ |
|
301 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr)) |
|
302 |
|
303 #else |
|
304 |
|
305 typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream); |
|
306 #define NewNPP_WriteReadyProc(FUNC) \ |
|
307 ((NPP_WriteReadyUPP) (FUNC)) |
|
308 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ |
|
309 (*(FUNC))((NPParg), (NPStreamPtr)) |
|
310 |
|
311 #endif |
|
312 |
|
313 |
|
314 /* NPP_Write */ |
|
315 |
|
316 #if _NPUPP_USE_UPP_ |
|
317 |
|
318 typedef UniversalProcPtr NPP_WriteUPP; |
|
319 enum { |
|
320 uppNPP_WriteProcInfo = kThinkCStackBased |
|
321 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
322 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
323 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) |
|
324 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) |
|
325 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) |
|
326 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
|
327 }; |
|
328 #define NewNPP_WriteProc(FUNC) \ |
|
329 (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture()) |
|
330 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ |
|
331 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) |
|
332 |
|
333 #else |
|
334 |
|
335 typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); |
|
336 #define NewNPP_WriteProc(FUNC) \ |
|
337 ((NPP_WriteUPP) (FUNC)) |
|
338 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ |
|
339 (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) |
|
340 |
|
341 #endif |
|
342 |
|
343 |
|
344 /* NPP_StreamAsFile */ |
|
345 |
|
346 #if _NPUPP_USE_UPP_ |
|
347 |
|
348 typedef UniversalProcPtr NPP_StreamAsFileUPP; |
|
349 enum { |
|
350 uppNPP_StreamAsFileProcInfo = kThinkCStackBased |
|
351 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
352 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
353 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) |
|
354 | RESULT_SIZE(SIZE_CODE(0)) |
|
355 }; |
|
356 #define NewNPP_StreamAsFileProc(FUNC) \ |
|
357 (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture()) |
|
358 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ |
|
359 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3)) |
|
360 |
|
361 #else |
|
362 #ifndef __SYMBIAN32__ |
|
363 typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname); |
|
364 #define NewNPP_StreamAsFileProc(FUNC) \ |
|
365 ((NPP_StreamAsFileUPP) (FUNC)) |
|
366 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ |
|
367 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
368 #else/* __SYMBIAN32__ */ |
|
369 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, |
|
370 const TDesC& fname); |
|
371 typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, |
|
372 const TDesC& fname); |
|
373 #define NewNPP_StreamAsFileProc(FUNC) \ |
|
374 ((NPP_StreamAsFileUPP) (FUNC)) |
|
375 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ |
|
376 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
377 #endif /* __SYMBIAN32__ */ |
|
378 |
|
379 #endif |
|
380 |
|
381 |
|
382 /* NPP_Print */ |
|
383 |
|
384 #if _NPUPP_USE_UPP_ |
|
385 |
|
386 typedef UniversalProcPtr NPP_PrintUPP; |
|
387 enum { |
|
388 uppNPP_PrintProcInfo = kThinkCStackBased |
|
389 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
390 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) |
|
391 | RESULT_SIZE(SIZE_CODE(0)) |
|
392 }; |
|
393 #define NewNPP_PrintProc(FUNC) \ |
|
394 (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture()) |
|
395 #define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ |
|
396 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr)) |
|
397 |
|
398 #else |
|
399 |
|
400 typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); |
|
401 #define NewNPP_PrintProc(FUNC) \ |
|
402 ((NPP_PrintUPP) (FUNC)) |
|
403 #define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ |
|
404 (*(FUNC))((NPParg), (NPPrintArg)) |
|
405 |
|
406 #endif |
|
407 |
|
408 |
|
409 /* NPP_HandleEvent */ |
|
410 |
|
411 #if _NPUPP_USE_UPP_ |
|
412 |
|
413 typedef UniversalProcPtr NPP_HandleEventUPP; |
|
414 enum { |
|
415 uppNPP_HandleEventProcInfo = kThinkCStackBased |
|
416 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
417 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) |
|
418 | RESULT_SIZE(SIZE_CODE(sizeof(int16))) |
|
419 }; |
|
420 #define NewNPP_HandleEventProc(FUNC) \ |
|
421 (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture()) |
|
422 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ |
|
423 (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr)) |
|
424 |
|
425 #else |
|
426 |
|
427 typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event); |
|
428 #define NewNPP_HandleEventProc(FUNC) \ |
|
429 ((NPP_HandleEventUPP) (FUNC)) |
|
430 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ |
|
431 (*(FUNC))((NPParg), (voidPtr)) |
|
432 |
|
433 #endif |
|
434 |
|
435 |
|
436 /* NPP_URLNotify */ |
|
437 |
|
438 #if _NPUPP_USE_UPP_ |
|
439 |
|
440 typedef UniversalProcPtr NPP_URLNotifyUPP; |
|
441 enum { |
|
442 uppNPP_URLNotifyProcInfo = kThinkCStackBased |
|
443 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
444 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
|
445 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
|
446 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
|
447 | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) |
|
448 }; |
|
449 #define NewNPP_URLNotifyProc(FUNC) \ |
|
450 (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture()) |
|
451 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
452 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
|
453 |
|
454 #else |
|
455 #ifndef __SYMBIAN32__ |
|
456 typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData); |
|
457 #define NewNPP_URLNotifyProc(FUNC) \ |
|
458 ((NPP_URLNotifyUPP) (FUNC)) |
|
459 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
460 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
|
461 #else/* __SYMBIAN32__ */ |
|
462 typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const TDesC& url, |
|
463 NPReason reason, void* notifyData); |
|
464 #define NewNPP_URLNotifyProc(FUNC) \ |
|
465 ((NPP_URLNotifyUPP) (FUNC)) |
|
466 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
467 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
|
468 #endif /* __SYMBIAN32__ */ |
|
469 |
|
470 #endif |
|
471 |
|
472 |
|
473 /* NPP_GetValue */ |
|
474 |
|
475 #if _NPUPP_USE_UPP_ |
|
476 |
|
477 typedef UniversalProcPtr NPP_GetValueUPP; |
|
478 enum { |
|
479 uppNPP_GetValueProcInfo = kThinkCStackBased |
|
480 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
481 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) |
|
482 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
|
483 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
484 }; |
|
485 #define NewNPP_GetValueProc(FUNC) \ |
|
486 (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture()) |
|
487 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
488 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) |
|
489 #else |
|
490 |
|
491 typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue); |
|
492 #define NewNPP_GetValueProc(FUNC) \ |
|
493 ((NPP_GetValueUPP) (FUNC)) |
|
494 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
495 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
496 #endif |
|
497 |
|
498 |
|
499 /* NPP_SetValue */ |
|
500 |
|
501 #if _NPUPP_USE_UPP_ |
|
502 |
|
503 typedef UniversalProcPtr NPP_SetValueUPP; |
|
504 enum { |
|
505 uppNPP_SetValueProcInfo = kThinkCStackBased |
|
506 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
507 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) |
|
508 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
|
509 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
510 }; |
|
511 #define NewNPP_SetValueProc(FUNC) \ |
|
512 (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture()) |
|
513 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
514 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3)) |
|
515 #else |
|
516 |
|
517 typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); |
|
518 #define NewNPP_SetValueProc(FUNC) \ |
|
519 ((NPP_SetValueUPP) (FUNC)) |
|
520 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
521 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
522 #endif |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 /* |
|
528 * Netscape entry points |
|
529 */ |
|
530 |
|
531 |
|
532 /* NPN_GetValue */ |
|
533 |
|
534 #if _NPUPP_USE_UPP_ |
|
535 |
|
536 typedef UniversalProcPtr NPN_GetValueUPP; |
|
537 enum { |
|
538 uppNPN_GetValueProcInfo = kThinkCStackBased |
|
539 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
540 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) |
|
541 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
|
542 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
543 }; |
|
544 #define NewNPN_GetValueProc(FUNC) \ |
|
545 (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture()) |
|
546 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
547 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) |
|
548 #else |
|
549 |
|
550 typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); |
|
551 #define NewNPN_GetValueProc(FUNC) \ |
|
552 ((NPN_GetValueUPP) (FUNC)) |
|
553 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
554 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
555 #endif |
|
556 |
|
557 |
|
558 /* NPN_SetValue */ |
|
559 |
|
560 #if _NPUPP_USE_UPP_ |
|
561 |
|
562 typedef UniversalProcPtr NPN_SetValueUPP; |
|
563 enum { |
|
564 uppNPN_SetValueProcInfo = kThinkCStackBased |
|
565 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
566 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) |
|
567 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
|
568 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
569 }; |
|
570 #define NewNPN_SetValueProc(FUNC) \ |
|
571 (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture()) |
|
572 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
573 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3)) |
|
574 #else |
|
575 |
|
576 typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue); |
|
577 #define NewNPN_SetValueProc(FUNC) \ |
|
578 ((NPN_SetValueUPP) (FUNC)) |
|
579 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
|
580 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
581 #endif |
|
582 |
|
583 |
|
584 /* NPN_GetUrlNotify */ |
|
585 |
|
586 #if _NPUPP_USE_UPP_ |
|
587 |
|
588 typedef UniversalProcPtr NPN_GetURLNotifyUPP; |
|
589 enum { |
|
590 uppNPN_GetURLNotifyProcInfo = kThinkCStackBased |
|
591 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
592 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
|
593 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
|
594 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
|
595 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
596 }; |
|
597 #define NewNPN_GetURLNotifyProc(FUNC) \ |
|
598 (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture()) |
|
599 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
600 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
|
601 #else |
|
602 #ifndef __SYMBIAN32__ |
|
603 typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData); |
|
604 #define NewNPN_GetURLNotifyProc(FUNC) \ |
|
605 ((NPN_GetURLNotifyUPP) (FUNC)) |
|
606 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
607 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
|
608 #else/* __SYMBIAN32__ */ |
|
609 typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const TDesC& url, |
|
610 const TDesC* target, void* notifyData); |
|
611 #define NewNPN_GetURLNotifyProc(FUNC) \ |
|
612 ((NPN_GetURLNotifyUPP) (FUNC)) |
|
613 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
|
614 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
|
615 #endif /* __SYMBIAN32__ */ |
|
616 |
|
617 #endif |
|
618 |
|
619 |
|
620 /* NPN_PostUrlNotify */ |
|
621 |
|
622 #if _NPUPP_USE_UPP_ |
|
623 |
|
624 typedef UniversalProcPtr NPN_PostURLNotifyUPP; |
|
625 enum { |
|
626 uppNPN_PostURLNotifyProcInfo = kThinkCStackBased |
|
627 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
628 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
|
629 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
|
630 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) |
|
631 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) |
|
632 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) |
|
633 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) |
|
634 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
635 }; |
|
636 #define NewNPN_PostURLNotifyProc(FUNC) \ |
|
637 (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) |
|
638 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ |
|
639 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
|
640 #else |
|
641 #ifndef __SYMBIAN32__ |
|
642 typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); |
|
643 #define NewNPN_PostURLNotifyProc(FUNC) \ |
|
644 ((NPN_PostURLNotifyUPP) (FUNC)) |
|
645 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ |
|
646 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
|
647 #else/* __SYMBIAN32__ */ |
|
648 typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const TDesC& url, |
|
649 const TDesC* target, |
|
650 const TDesC& buf, NPBool file, |
|
651 void* notifyData); |
|
652 #define NewNPN_PostURLNotifyProc(FUNC) \ |
|
653 ((NPN_PostURLNotifyUPP) (FUNC)) |
|
654 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
|
655 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
|
656 #endif /* __SYMBIAN32__ */ |
|
657 |
|
658 |
|
659 #endif |
|
660 |
|
661 |
|
662 /* NPN_GetUrl */ |
|
663 |
|
664 #if _NPUPP_USE_UPP_ |
|
665 |
|
666 typedef UniversalProcPtr NPN_GetURLUPP; |
|
667 enum { |
|
668 uppNPN_GetURLProcInfo = kThinkCStackBased |
|
669 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
670 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
|
671 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
|
672 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
673 }; |
|
674 #define NewNPN_GetURLProc(FUNC) \ |
|
675 (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture()) |
|
676 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ |
|
677 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3)) |
|
678 #else |
|
679 #ifndef __SYMBIAN32__ |
|
680 typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window); |
|
681 #define NewNPN_GetURLProc(FUNC) \ |
|
682 ((NPN_GetURLUPP) (FUNC)) |
|
683 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ |
|
684 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
685 #else/* __SYMBIAN32__ */ |
|
686 typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const TDesC& url, |
|
687 const TDesC* target); |
|
688 #define NewNPN_GetURLProc(FUNC) \ |
|
689 ((NPN_GetURLUPP) (FUNC)) |
|
690 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ |
|
691 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
|
692 #endif /* __SYMBIAN32__ */ |
|
693 |
|
694 #endif |
|
695 |
|
696 |
|
697 /* NPN_PostUrl */ |
|
698 |
|
699 #if _NPUPP_USE_UPP_ |
|
700 |
|
701 typedef UniversalProcPtr NPN_PostURLUPP; |
|
702 enum { |
|
703 uppNPN_PostURLProcInfo = kThinkCStackBased |
|
704 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
705 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
|
706 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
|
707 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) |
|
708 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) |
|
709 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) |
|
710 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
711 }; |
|
712 #define NewNPN_PostURLProc(FUNC) \ |
|
713 (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture()) |
|
714 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
|
715 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
|
716 #else |
|
717 #ifndef __SYMBIAN32__ |
|
718 typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file); |
|
719 #define NewNPN_PostURLProc(FUNC) \ |
|
720 ((NPN_PostURLUPP) (FUNC)) |
|
721 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
|
722 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
|
723 #else/* __SYMBIAN32__ */ |
|
724 typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const TDesC& url, |
|
725 const TDesC* target, |
|
726 const TDesC& buf, NPBool file); |
|
727 #define NewNPN_PostURLProc(FUNC) \ |
|
728 ((NPN_PostURLUPP) (FUNC)) |
|
729 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ |
|
730 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
|
731 #endif /* __SYMBIAN32__ */ |
|
732 #endif |
|
733 |
|
734 |
|
735 /* NPN_RequestRead */ |
|
736 |
|
737 #if _NPUPP_USE_UPP_ |
|
738 |
|
739 typedef UniversalProcPtr NPN_RequestReadUPP; |
|
740 enum { |
|
741 uppNPN_RequestReadProcInfo = kThinkCStackBased |
|
742 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) |
|
743 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) |
|
744 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
745 }; |
|
746 #define NewNPN_RequestReadProc(FUNC) \ |
|
747 (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture()) |
|
748 #define CallNPN_RequestReadProc(FUNC, stream, range) \ |
|
749 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range)) |
|
750 |
|
751 #else |
|
752 |
|
753 typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList); |
|
754 #define NewNPN_RequestReadProc(FUNC) \ |
|
755 ((NPN_RequestReadUPP) (FUNC)) |
|
756 #define CallNPN_RequestReadProc(FUNC, stream, range) \ |
|
757 (*(FUNC))((stream), (range)) |
|
758 |
|
759 #endif |
|
760 |
|
761 |
|
762 /* NPN_NewStream */ |
|
763 |
|
764 #if _NPUPP_USE_UPP_ |
|
765 |
|
766 typedef UniversalProcPtr NPN_NewStreamUPP; |
|
767 enum { |
|
768 uppNPN_NewStreamProcInfo = kThinkCStackBased |
|
769 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
770 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) |
|
771 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) |
|
772 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) |
|
773 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
774 }; |
|
775 #define NewNPN_NewStreamProc(FUNC) \ |
|
776 (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture()) |
|
777 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ |
|
778 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) |
|
779 |
|
780 #else |
|
781 #ifndef __SYMBIAN32__ |
|
782 typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); |
|
783 #define NewNPN_NewStreamProc(FUNC) \ |
|
784 ((NPN_NewStreamUPP) (FUNC)) |
|
785 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ |
|
786 (*(FUNC))((npp), (type), (window), (stream)) |
|
787 #else/* __SYMBIAN32__ */ |
|
788 typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, |
|
789 const TDesC* target, NPStream** stream); |
|
790 #define NewNPN_NewStreamProc(FUNC) \ |
|
791 ((NPN_NewStreamUPP) (FUNC)) |
|
792 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ |
|
793 (*(FUNC))((npp), (type), (window), (stream)) |
|
794 #endif /* __SYMBIAN32__ */ |
|
795 |
|
796 |
|
797 #endif |
|
798 |
|
799 |
|
800 /* NPN_Write */ |
|
801 |
|
802 #if _NPUPP_USE_UPP_ |
|
803 |
|
804 typedef UniversalProcPtr NPN_WriteUPP; |
|
805 enum { |
|
806 uppNPN_WriteProcInfo = kThinkCStackBased |
|
807 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
808 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
809 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) |
|
810 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
|
811 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
|
812 }; |
|
813 #define NewNPN_WriteProc(FUNC) \ |
|
814 (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture()) |
|
815 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ |
|
816 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer)) |
|
817 |
|
818 #else |
|
819 |
|
820 typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer); |
|
821 #define NewNPN_WriteProc(FUNC) \ |
|
822 ((NPN_WriteUPP) (FUNC)) |
|
823 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ |
|
824 (*(FUNC))((npp), (stream), (len), (buffer)) |
|
825 |
|
826 #endif |
|
827 |
|
828 |
|
829 /* NPN_DestroyStream */ |
|
830 |
|
831 #if _NPUPP_USE_UPP_ |
|
832 |
|
833 typedef UniversalProcPtr NPN_DestroyStreamUPP; |
|
834 enum { |
|
835 uppNPN_DestroyStreamProcInfo = kThinkCStackBased |
|
836 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) |
|
837 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
|
838 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
|
839 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
840 }; |
|
841 #define NewNPN_DestroyStreamProc(FUNC) \ |
|
842 (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture()) |
|
843 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ |
|
844 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) |
|
845 |
|
846 #else |
|
847 |
|
848 typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); |
|
849 #define NewNPN_DestroyStreamProc(FUNC) \ |
|
850 ((NPN_DestroyStreamUPP) (FUNC)) |
|
851 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ |
|
852 (*(FUNC))((npp), (stream), (reason)) |
|
853 |
|
854 #endif |
|
855 |
|
856 |
|
857 /* NPN_Status */ |
|
858 |
|
859 #if _NPUPP_USE_UPP_ |
|
860 |
|
861 typedef UniversalProcPtr NPN_StatusUPP; |
|
862 enum { |
|
863 uppNPN_StatusProcInfo = kThinkCStackBased |
|
864 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
865 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) |
|
866 }; |
|
867 |
|
868 #define NewNPN_StatusProc(FUNC) \ |
|
869 (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture()) |
|
870 #define CallNPN_StatusProc(FUNC, npp, msg) \ |
|
871 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg)) |
|
872 |
|
873 #else |
|
874 #ifndef __SYMBIAN32__ |
|
875 typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message); |
|
876 #define NewNPN_StatusProc(FUNC) \ |
|
877 ((NPN_StatusUPP) (FUNC)) |
|
878 #define CallNPN_StatusProc(FUNC, npp, msg) \ |
|
879 (*(FUNC))((npp), (msg)) |
|
880 #else/* __SYMBIAN32__ */ |
|
881 typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const TDesC& message); |
|
882 #define NewNPN_StatusProc(FUNC) \ |
|
883 ((NPN_StatusUPP) (FUNC)) |
|
884 #define CallNPN_StatusProc(FUNC, npp, msg) \ |
|
885 (*(FUNC))((npp), (msg)) |
|
886 #endif /* __SYMBIAN32__ */ |
|
887 |
|
888 #endif |
|
889 |
|
890 |
|
891 /* NPN_UserAgent */ |
|
892 #if _NPUPP_USE_UPP_ |
|
893 |
|
894 typedef UniversalProcPtr NPN_UserAgentUPP; |
|
895 enum { |
|
896 uppNPN_UserAgentProcInfo = kThinkCStackBased |
|
897 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
898 | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) |
|
899 }; |
|
900 |
|
901 #define NewNPN_UserAgentProc(FUNC) \ |
|
902 (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture()) |
|
903 #define CallNPN_UserAgentProc(FUNC, ARG1) \ |
|
904 (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1)) |
|
905 |
|
906 #else |
|
907 #ifndef __SYMBIAN32__ |
|
908 typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance); |
|
909 #define NewNPN_UserAgentProc(FUNC) \ |
|
910 ((NPN_UserAgentUPP) (FUNC)) |
|
911 #define CallNPN_UserAgentProc(FUNC, ARG1) \ |
|
912 (*(FUNC))((ARG1)) |
|
913 #else/* __SYMBIAN32__ */ |
|
914 typedef const TDesC* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance); |
|
915 #define NewNPN_UserAgentProc(FUNC) \ |
|
916 ((NPN_UserAgentUPP) (FUNC)) |
|
917 #define CallNPN_UserAgentProc(FUNC, ARG1) \ |
|
918 (*(FUNC))((ARG1)) |
|
919 #endif /* __SYMBIAN32__ */ |
|
920 |
|
921 #endif |
|
922 |
|
923 |
|
924 /* NPN_MemAlloc */ |
|
925 #if _NPUPP_USE_UPP_ |
|
926 |
|
927 typedef UniversalProcPtr NPN_MemAllocUPP; |
|
928 enum { |
|
929 uppNPN_MemAllocProcInfo = kThinkCStackBased |
|
930 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) |
|
931 | RESULT_SIZE(SIZE_CODE(sizeof(void *))) |
|
932 }; |
|
933 |
|
934 #define NewNPN_MemAllocProc(FUNC) \ |
|
935 (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture()) |
|
936 #define CallNPN_MemAllocProc(FUNC, ARG1) \ |
|
937 (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) |
|
938 |
|
939 #else |
|
940 |
|
941 typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size); |
|
942 #define NewNPN_MemAllocProc(FUNC) \ |
|
943 ((NPN_MemAllocUPP) (FUNC)) |
|
944 #define CallNPN_MemAllocProc(FUNC, ARG1) \ |
|
945 (*(FUNC))((ARG1)) |
|
946 |
|
947 #endif |
|
948 |
|
949 |
|
950 /* NPN__MemFree */ |
|
951 |
|
952 #if _NPUPP_USE_UPP_ |
|
953 |
|
954 typedef UniversalProcPtr NPN_MemFreeUPP; |
|
955 enum { |
|
956 uppNPN_MemFreeProcInfo = kThinkCStackBased |
|
957 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) |
|
958 }; |
|
959 |
|
960 #define NewNPN_MemFreeProc(FUNC) \ |
|
961 (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture()) |
|
962 #define CallNPN_MemFreeProc(FUNC, ARG1) \ |
|
963 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1)) |
|
964 |
|
965 #else |
|
966 |
|
967 typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr); |
|
968 #define NewNPN_MemFreeProc(FUNC) \ |
|
969 ((NPN_MemFreeUPP) (FUNC)) |
|
970 #define CallNPN_MemFreeProc(FUNC, ARG1) \ |
|
971 (*(FUNC))((ARG1)) |
|
972 |
|
973 #endif |
|
974 |
|
975 |
|
976 /* NPN_MemFlush */ |
|
977 |
|
978 #if _NPUPP_USE_UPP_ |
|
979 |
|
980 typedef UniversalProcPtr NPN_MemFlushUPP; |
|
981 enum { |
|
982 uppNPN_MemFlushProcInfo = kThinkCStackBased |
|
983 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) |
|
984 | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) |
|
985 }; |
|
986 |
|
987 #define NewNPN_MemFlushProc(FUNC) \ |
|
988 (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture()) |
|
989 #define CallNPN_MemFlushProc(FUNC, ARG1) \ |
|
990 (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1)) |
|
991 |
|
992 #else |
|
993 |
|
994 typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size); |
|
995 #define NewNPN_MemFlushProc(FUNC) \ |
|
996 ((NPN_MemFlushUPP) (FUNC)) |
|
997 #define CallNPN_MemFlushProc(FUNC, ARG1) \ |
|
998 (*(FUNC))((ARG1)) |
|
999 |
|
1000 #endif |
|
1001 |
|
1002 |
|
1003 |
|
1004 /* NPN_ReloadPlugins */ |
|
1005 |
|
1006 #if _NPUPP_USE_UPP_ |
|
1007 |
|
1008 typedef UniversalProcPtr NPN_ReloadPluginsUPP; |
|
1009 enum { |
|
1010 uppNPN_ReloadPluginsProcInfo = kThinkCStackBased |
|
1011 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) |
|
1012 | RESULT_SIZE(SIZE_CODE(0)) |
|
1013 }; |
|
1014 |
|
1015 #define NewNPN_ReloadPluginsProc(FUNC) \ |
|
1016 (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) |
|
1017 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ |
|
1018 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) |
|
1019 |
|
1020 #else |
|
1021 |
|
1022 typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages); |
|
1023 #define NewNPN_ReloadPluginsProc(FUNC) \ |
|
1024 ((NPN_ReloadPluginsUPP) (FUNC)) |
|
1025 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ |
|
1026 (*(FUNC))((ARG1)) |
|
1027 |
|
1028 #endif |
|
1029 |
|
1030 #ifdef JRI_H |
|
1031 /* NPN_GetJavaEnv */ |
|
1032 |
|
1033 #if _NPUPP_USE_UPP_ |
|
1034 |
|
1035 typedef UniversalProcPtr NPN_GetJavaEnvUPP; |
|
1036 enum { |
|
1037 uppNPN_GetJavaEnvProcInfo = kThinkCStackBased |
|
1038 | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*))) |
|
1039 }; |
|
1040 |
|
1041 #define NewNPN_GetJavaEnvProc(FUNC) \ |
|
1042 (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture()) |
|
1043 #define CallNPN_GetJavaEnvProc(FUNC) \ |
|
1044 (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) |
|
1045 |
|
1046 #else |
|
1047 typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void); |
|
1048 #define NewNPN_GetJavaEnvProc(FUNC) \ |
|
1049 ((NPN_GetJavaEnvUPP) (FUNC)) |
|
1050 #define CallNPN_GetJavaEnvProc(FUNC) \ |
|
1051 (*(FUNC))() |
|
1052 |
|
1053 #endif |
|
1054 |
|
1055 |
|
1056 /* NPN_GetJavaPeer */ |
|
1057 |
|
1058 #if _NPUPP_USE_UPP_ |
|
1059 |
|
1060 typedef UniversalProcPtr NPN_GetJavaPeerUPP; |
|
1061 enum { |
|
1062 uppNPN_GetJavaPeerProcInfo = kThinkCStackBased |
|
1063 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
1064 | RESULT_SIZE(SIZE_CODE(sizeof(jref))) |
|
1065 }; |
|
1066 |
|
1067 #define NewNPN_GetJavaPeerProc(FUNC) \ |
|
1068 (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture()) |
|
1069 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ |
|
1070 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) |
|
1071 |
|
1072 #else |
|
1073 |
|
1074 typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance); |
|
1075 #define NewNPN_GetJavaPeerProc(FUNC) \ |
|
1076 ((NPN_GetJavaPeerUPP) (FUNC)) |
|
1077 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ |
|
1078 (*(FUNC))((ARG1)) |
|
1079 |
|
1080 #endif |
|
1081 |
|
1082 #else//#ifdef JRI_H |
|
1083 typedef void JRIEnv; |
|
1084 typedef void* JRIGlobalRef; |
|
1085 typedef void* jref; |
|
1086 typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void); |
|
1087 #define NewNPN_GetJavaEnvProc(FUNC) \ |
|
1088 ((NPN_GetJavaEnvUPP) (FUNC)) |
|
1089 #define CallNPN_GetJavaEnvProc(FUNC) \ |
|
1090 (*(FUNC))() |
|
1091 typedef jref (*NPN_GetJavaPeerUPP)(NPP instance); |
|
1092 #define NewNPN_GetJavaPeerProc(FUNC) \ |
|
1093 ((NPN_GetJavaPeerUPP) (FUNC)) |
|
1094 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ |
|
1095 (*(FUNC))((ARG1)) |
|
1096 #endif//#ifdef JRI_H |
|
1097 |
|
1098 /* NPN_InvalidateRect */ |
|
1099 |
|
1100 #if _NPUPP_USE_UPP_ |
|
1101 |
|
1102 typedef UniversalProcPtr NPN_InvalidateRectUPP; |
|
1103 enum { |
|
1104 uppNPN_InvalidateRectProcInfo = kThinkCStackBased |
|
1105 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
1106 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *))) |
|
1107 | RESULT_SIZE(SIZE_CODE(0)) |
|
1108 }; |
|
1109 |
|
1110 #define NewNPN_InvalidateRectProc(FUNC) \ |
|
1111 (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture()) |
|
1112 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ |
|
1113 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2)) |
|
1114 |
|
1115 #else |
|
1116 |
|
1117 typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect); |
|
1118 #define NewNPN_InvalidateRectProc(FUNC) \ |
|
1119 ((NPN_InvalidateRectUPP) (FUNC)) |
|
1120 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ |
|
1121 (*(FUNC))((ARG1), (ARG2)) |
|
1122 |
|
1123 #endif |
|
1124 |
|
1125 |
|
1126 /* NPN_InvalidateRegion */ |
|
1127 |
|
1128 #if _NPUPP_USE_UPP_ |
|
1129 |
|
1130 typedef UniversalProcPtr NPN_InvalidateRegionUPP; |
|
1131 enum { |
|
1132 uppNPN_InvalidateRegionProcInfo = kThinkCStackBased |
|
1133 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
1134 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion))) |
|
1135 | RESULT_SIZE(SIZE_CODE(0)) |
|
1136 }; |
|
1137 |
|
1138 #define NewNPN_InvalidateRegionProc(FUNC) \ |
|
1139 (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture()) |
|
1140 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ |
|
1141 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2)) |
|
1142 |
|
1143 #else |
|
1144 |
|
1145 typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region); |
|
1146 #define NewNPN_InvalidateRegionProc(FUNC) \ |
|
1147 ((NPN_InvalidateRegionUPP) (FUNC)) |
|
1148 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ |
|
1149 (*(FUNC))((ARG1), (ARG2)) |
|
1150 |
|
1151 #endif |
|
1152 |
|
1153 /* NPN_ForceRedraw */ |
|
1154 |
|
1155 #if _NPUPP_USE_UPP_ |
|
1156 |
|
1157 typedef UniversalProcPtr NPN_ForceRedrawUPP; |
|
1158 enum { |
|
1159 uppNPN_ForceRedrawProcInfo = kThinkCStackBased |
|
1160 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
|
1161 | RESULT_SIZE(SIZE_CODE(sizeof(0))) |
|
1162 }; |
|
1163 |
|
1164 #define NewNPN_ForceRedrawProc(FUNC) \ |
|
1165 (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture()) |
|
1166 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \ |
|
1167 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1)) |
|
1168 |
|
1169 #else |
|
1170 |
|
1171 typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance); |
|
1172 #define NewNPN_ForceRedrawProc(FUNC) \ |
|
1173 ((NPN_ForceRedrawUPP) (FUNC)) |
|
1174 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \ |
|
1175 (*(FUNC))((ARG1)) |
|
1176 |
|
1177 #endif |
|
1178 |
|
1179 |
|
1180 /****************************************************************************************** |
|
1181 * The actual plugin function table definitions |
|
1182 *******************************************************************************************/ |
|
1183 |
|
1184 #ifdef XP_MAC |
|
1185 #if PRAGMA_STRUCT_ALIGN |
|
1186 #pragma options align=mac68k |
|
1187 #endif |
|
1188 #endif |
|
1189 |
|
1190 typedef struct _NPPluginFuncs { |
|
1191 uint16 size; |
|
1192 uint16 version; |
|
1193 NPP_NewUPP newp; |
|
1194 NPP_DestroyUPP destroy; |
|
1195 NPP_SetWindowUPP setwindow; |
|
1196 NPP_NewStreamUPP newstream; |
|
1197 NPP_DestroyStreamUPP destroystream; |
|
1198 NPP_StreamAsFileUPP asfile; |
|
1199 NPP_WriteReadyUPP writeready; |
|
1200 NPP_WriteUPP write; |
|
1201 NPP_PrintUPP print; |
|
1202 NPP_HandleEventUPP event; |
|
1203 NPP_URLNotifyUPP urlnotify; |
|
1204 JRIGlobalRef javaClass; |
|
1205 NPP_GetValueUPP getvalue; |
|
1206 NPP_SetValueUPP setvalue; |
|
1207 } NPPluginFuncs; |
|
1208 |
|
1209 typedef struct _NPNetscapeFuncs { |
|
1210 uint16 size; |
|
1211 uint16 version; |
|
1212 NPN_GetURLUPP geturl; |
|
1213 NPN_PostURLUPP posturl; |
|
1214 NPN_RequestReadUPP requestread; |
|
1215 NPN_NewStreamUPP newstream; |
|
1216 NPN_WriteUPP write; |
|
1217 NPN_DestroyStreamUPP destroystream; |
|
1218 NPN_StatusUPP status; |
|
1219 NPN_UserAgentUPP uagent; |
|
1220 NPN_MemAllocUPP memalloc; |
|
1221 NPN_MemFreeUPP memfree; |
|
1222 NPN_MemFlushUPP memflush; |
|
1223 NPN_ReloadPluginsUPP reloadplugins; |
|
1224 NPN_GetJavaEnvUPP getJavaEnv; |
|
1225 NPN_GetJavaPeerUPP getJavaPeer; |
|
1226 NPN_GetURLNotifyUPP geturlnotify; |
|
1227 NPN_PostURLNotifyUPP posturlnotify; |
|
1228 NPN_GetValueUPP getvalue; |
|
1229 NPN_SetValueUPP setvalue; |
|
1230 NPN_InvalidateRectUPP invalidaterect; |
|
1231 NPN_InvalidateRegionUPP invalidateregion; |
|
1232 NPN_ForceRedrawUPP forceredraw; |
|
1233 } NPNetscapeFuncs; |
|
1234 |
|
1235 #ifdef XP_MAC |
|
1236 #if PRAGMA_STRUCT_ALIGN |
|
1237 #pragma options align=reset |
|
1238 #endif |
|
1239 #endif |
|
1240 |
|
1241 |
|
1242 #if defined(XP_MAC) || defined(XP_MACOSX) |
|
1243 /****************************************************************************************** |
|
1244 * Mac platform-specific plugin glue stuff |
|
1245 *******************************************************************************************/ |
|
1246 |
|
1247 /* |
|
1248 * Main entry point of the plugin. |
|
1249 * This routine will be called when the plugin is loaded. The function |
|
1250 * tables are passed in and the plugin fills in the NPPluginFuncs table |
|
1251 * and NPPShutdownUPP for Netscape's use. |
|
1252 */ |
|
1253 |
|
1254 #if _NPUPP_USE_UPP_ |
|
1255 |
|
1256 typedef UniversalProcPtr NPP_MainEntryUPP; |
|
1257 enum { |
|
1258 uppNPP_MainEntryProcInfo = kThinkCStackBased |
|
1259 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))) |
|
1260 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) |
|
1261 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))) |
|
1262 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
|
1263 }; |
|
1264 #define NewNPP_MainEntryProc(FUNC) \ |
|
1265 (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture()) |
|
1266 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ |
|
1267 CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) |
|
1268 |
|
1269 #else |
|
1270 |
|
1271 typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*); |
|
1272 #define NewNPP_MainEntryProc(FUNC) \ |
|
1273 ((NPP_MainEntryUPP) (FUNC)) |
|
1274 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ |
|
1275 (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) |
|
1276 |
|
1277 #endif |
|
1278 |
|
1279 |
|
1280 /* |
|
1281 * Mac version(s) of NP_GetMIMEDescription(const char *) |
|
1282 * These can be called to retreive MIME information from the plugin dynamically |
|
1283 * |
|
1284 * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way |
|
1285 * to get mime info from the plugin only on OSX and may not be supported |
|
1286 * in furture version--use NP_GetMIMEDescription instead |
|
1287 */ |
|
1288 |
|
1289 enum |
|
1290 { |
|
1291 kBPSupportedMIMETypesStructVers_1 = 1 |
|
1292 }; |
|
1293 |
|
1294 typedef struct _BPSupportedMIMETypes |
|
1295 { |
|
1296 SInt32 structVersion; /* struct version */ |
|
1297 Handle typeStrings; /* STR# formated handle, allocated by plug-in */ |
|
1298 Handle infoStrings; /* STR# formated handle, allocated by plug-in */ |
|
1299 } BPSupportedMIMETypes; |
|
1300 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags); |
|
1301 |
|
1302 #if _NPUPP_USE_UPP_ |
|
1303 |
|
1304 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD" |
|
1305 typedef UniversalProcPtr NP_GetMIMEDescriptionUPP; |
|
1306 enum { |
|
1307 uppNP_GetMIMEDescEntryProc = kThinkCStackBased |
|
1308 | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) |
|
1309 }; |
|
1310 #define NewNP_GetMIMEDescEntryProc(FUNC) \ |
|
1311 (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture()) |
|
1312 #define CallNP_GetMIMEDescEntryProc(FUNC) \ |
|
1313 (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc) |
|
1314 |
|
1315 |
|
1316 #else /* !_NPUPP_USE_UPP_ */ |
|
1317 #ifndef __SYMBIAN32__ |
|
1318 typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)(); |
|
1319 #else/* __SYMBIAN32__ */ |
|
1320 typedef const TDesC* (* NP_LOADDS NP_GetMIMEDescriptionUPP)(); |
|
1321 #endif /* __SYMBIAN32__ */ |
|
1322 |
|
1323 /* NP_GetMIMEDescription */ |
|
1324 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription" |
|
1325 #define NewNP_GetMIMEDescEntryProc(FUNC) \ |
|
1326 ((NP_GetMIMEDescriptionUPP) (FUNC)) |
|
1327 #define CallNP_GetMIMEDescEntryProc(FUNC) \ |
|
1328 (*(FUNC))() |
|
1329 /* BP_GetSupportedMIMETypes */ |
|
1330 typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32); |
|
1331 #define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \ |
|
1332 ((BP_GetSupportedMIMETypesUPP) (FUNC)) |
|
1333 #define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \ |
|
1334 (*(FUNC))((mimeInfo), (flags)) |
|
1335 |
|
1336 #endif |
|
1337 #endif /* MAC */ |
|
1338 |
|
1339 #if defined(_WINDOWS) |
|
1340 #define OSCALL WINAPI |
|
1341 #else |
|
1342 #if defined(__OS2__) |
|
1343 #define OSCALL _System |
|
1344 #else |
|
1345 #define OSCALL |
|
1346 #endif |
|
1347 #endif |
|
1348 |
|
1349 #if defined( _WINDOWS ) || defined (__OS2__) |
|
1350 |
|
1351 #ifndef __SYMBIAN32__ |
|
1352 #ifdef __cplusplus |
|
1353 extern "C" { |
|
1354 #endif |
|
1355 #endif |
|
1356 |
|
1357 /* plugin meta member functions */ |
|
1358 #if defined(__OS2__) |
|
1359 |
|
1360 typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */ |
|
1361 char *pMimeTypes; |
|
1362 char *pFileExtents; |
|
1363 char *pFileOpenTemplate; |
|
1364 char *pProductName; |
|
1365 char *pProductDescription; |
|
1366 unsigned long dwProductVersionMS; |
|
1367 unsigned long dwProductVersionLS; |
|
1368 } NPPluginData; |
|
1369 |
|
1370 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData); |
|
1371 |
|
1372 #endif |
|
1373 |
|
1374 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs); |
|
1375 |
|
1376 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs); |
|
1377 |
|
1378 NPError OSCALL NP_Shutdown(); |
|
1379 |
|
1380 char* NP_GetMIMEDescription(); |
|
1381 |
|
1382 #ifndef __SYMBIAN32__ |
|
1383 #ifdef __cplusplus |
|
1384 } |
|
1385 #endif |
|
1386 #endif |
|
1387 |
|
1388 #endif /* _WINDOWS || __OS2__ */ |
|
1389 |
|
1390 #if defined(__OS2__) |
|
1391 #pragma pack() |
|
1392 #endif |
|
1393 |
|
1394 #ifdef XP_UNIX |
|
1395 |
|
1396 #ifndef __SYMBIAN32__ |
|
1397 #ifdef __cplusplus |
|
1398 extern "C" { |
|
1399 #endif |
|
1400 #endif |
|
1401 |
|
1402 /* plugin meta member functions */ |
|
1403 #ifndef __SYMBIAN32__ |
|
1404 char* NP_GetMIMEDescription(void); |
|
1405 NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); |
|
1406 NPError NP_Shutdown(void); |
|
1407 NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue); |
|
1408 #else |
|
1409 IMPORT_C const TDesC* NP_GetMIMEDescription(void); |
|
1410 IMPORT_C NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); |
|
1411 IMPORT_C void NP_Shutdown(void); |
|
1412 IMPORT_C NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue); |
|
1413 #endif /* __SYMBIAN32__ */ |
|
1414 |
|
1415 #ifndef __SYMBIAN32__ |
|
1416 #ifdef __cplusplus |
|
1417 } |
|
1418 #endif |
|
1419 #endif |
|
1420 |
|
1421 #endif /* XP_UNIX */ |
|
1422 |
|
1423 #endif /* _NPUPP_H_ */ |