npupp.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Netscape Public License
00006  * Version 1.1 (the "License"); you may not use this file except in
00007  * compliance with the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/NPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is 
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *    Portions Copyright (c) 2004-2006, Nokia Corporation
00024  *
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the NPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the NPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 /* NOTES:
00041  * Nokia modified this file, by changing certain variables for the purpose of
00042  * porting the file to the Symbian platform on May 1st, 2004.
00043  */
00044 
00045 
00046 /*
00047  *  npupp.h $Revision: 3.15 $
00048  *  function call mecahnics needed by platform specific glue code.
00049  */
00050 
00051 
00052 #ifndef _NPUPP_H_
00053 #define _NPUPP_H_
00054 
00055 #if defined(__OS2__)
00056 #pragma pack(1)
00057 #endif
00058 
00059 #ifndef GENERATINGCFM
00060 #define GENERATINGCFM 0
00061 #endif
00062 
00063 #ifndef _NPAPI_H_
00064 #include "npapi.h"
00065 #endif
00066 
00067 #include "jri.h"
00068 
00069 /******************************************************************************************
00070    plug-in function table macros
00071           for each function in and out of the plugin API we define
00072                     typedef NPP_FooUPP
00073           #define NewNPP_FooProc
00074           #define CallNPP_FooProc
00075       for mac, define the UPP magic for PPC/68K calling
00076  *******************************************************************************************/
00077 
00078 
00079 /* NPP_Initialize */
00080 
00081 #define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON)
00082 
00083 #if _NPUPP_USE_UPP_
00084 typedef UniversalProcPtr NPP_InitializeUPP;
00085 
00086 enum {
00087   uppNPP_InitializeProcInfo = kThinkCStackBased
00088     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))    
00089     | RESULT_SIZE(SIZE_CODE(0))
00090 };
00091 
00092 #define NewNPP_InitializeProc(FUNC)   \
00093     (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
00094 #define CallNPP_InitializeProc(FUNC)    \
00095     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
00096     
00097 #else
00098 
00099 typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
00100 #define NewNPP_InitializeProc(FUNC)   \
00101     ((NPP_InitializeUPP) (FUNC))
00102 #define CallNPP_InitializeProc(FUNC)    \
00103     (*(FUNC))()
00104 
00105 #endif
00106 
00107 
00108 /* NPP_Shutdown */
00109 
00110 #if _NPUPP_USE_UPP_
00111 typedef UniversalProcPtr NPP_ShutdownUPP;
00112 
00113 enum {
00114   uppNPP_ShutdownProcInfo = kThinkCStackBased
00115     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))    
00116     | RESULT_SIZE(SIZE_CODE(0))
00117 };
00118 
00119 #define NewNPP_ShutdownProc(FUNC)   \
00120     (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
00121 #define CallNPP_ShutdownProc(FUNC)    \
00122     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
00123     
00124 #else
00125 
00126 typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
00127 #define NewNPP_ShutdownProc(FUNC)   \
00128     ((NPP_ShutdownUPP) (FUNC))
00129 #define CallNPP_ShutdownProc(FUNC)    \
00130     (*(FUNC))()
00131 
00132 #endif
00133 
00134 
00135 /* NPP_New */
00136 
00137 #if _NPUPP_USE_UPP_
00138 typedef UniversalProcPtr NPP_NewUPP;
00139 
00140 enum {
00141   uppNPP_NewProcInfo = kThinkCStackBased
00142     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
00143     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
00144     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
00145     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
00146     | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
00147     | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
00148     | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
00149     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00150 };
00151 
00152 #define NewNPP_NewProc(FUNC)    \
00153     (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
00154 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00155     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
00156                    (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00157 #else
00158  #ifndef __SYMBIAN32__
00159   typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
00160   #define NewNPP_NewProc(FUNC)    \
00161       ((NPP_NewUPP) (FUNC))
00162   #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)   \
00163       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00164  #else/* __SYMBIAN32__ */
00165   typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance,
00166               uint16 mode, CDesCArray* argn,
00167               CDesCArray* argv, NPSavedData* saved);
00168   #define NewNPP_NewProc(FUNC)    \
00169       ((NPP_NewUPP) (FUNC))
00170   #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)   \
00171       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00172  #endif /* __SYMBIAN32__ */
00173 
00174 
00175 #endif
00176 
00177 
00178 /* NPP_Destroy */
00179 
00180 #if _NPUPP_USE_UPP_
00181 
00182 typedef UniversalProcPtr NPP_DestroyUPP;
00183 enum {
00184   uppNPP_DestroyProcInfo = kThinkCStackBased
00185     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00186     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
00187     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00188 };
00189 #define NewNPP_DestroyProc(FUNC)    \
00190     (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
00191 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2)   \
00192     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
00193 #else
00194 
00195 typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
00196 #define NewNPP_DestroyProc(FUNC)    \
00197     ((NPP_DestroyUPP) (FUNC))
00198 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2)   \
00199     (*(FUNC))((ARG1), (ARG2))
00200 
00201 #endif
00202 
00203 
00204 /* NPP_SetWindow */
00205 
00206 #if _NPUPP_USE_UPP_
00207 
00208 typedef UniversalProcPtr NPP_SetWindowUPP;
00209 enum {
00210   uppNPP_SetWindowProcInfo = kThinkCStackBased
00211     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00212     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
00213     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00214 };
00215 #define NewNPP_SetWindowProc(FUNC)    \
00216     (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
00217 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2)   \
00218     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
00219 
00220 #else
00221 
00222 typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
00223 #define NewNPP_SetWindowProc(FUNC)    \
00224     ((NPP_SetWindowUPP) (FUNC))
00225 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2)   \
00226     (*(FUNC))((ARG1), (ARG2))
00227 
00228 #endif
00229 
00230 
00231 /* NPP_NewStream */
00232 
00233 #if _NPUPP_USE_UPP_
00234 
00235 typedef UniversalProcPtr NPP_NewStreamUPP;
00236 enum {
00237   uppNPP_NewStreamProcInfo = kThinkCStackBased
00238     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00239     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
00240     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
00241     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
00242     | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
00243     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00244 };
00245 #define NewNPP_NewStreamProc(FUNC)    \
00246     (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
00247 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)   \
00248     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
00249 #else
00250 
00251 typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
00252 #define NewNPP_NewStreamProc(FUNC)    \
00253     ((NPP_NewStreamUPP) (FUNC))
00254 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
00255     (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
00256 #endif
00257 
00258 
00259 /* NPP_DestroyStream */
00260 
00261 #if _NPUPP_USE_UPP_
00262 
00263 typedef UniversalProcPtr NPP_DestroyStreamUPP;
00264 enum {
00265   uppNPP_DestroyStreamProcInfo = kThinkCStackBased
00266     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00267     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00268     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00269     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00270 };
00271 #define NewNPP_DestroyStreamProc(FUNC)    \
00272     (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
00273 #define CallNPP_DestroyStreamProc(FUNC,  NPParg, NPStreamPtr, NPReasonArg)    \
00274     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
00275 
00276 #else
00277 
00278 typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
00279 #define NewNPP_DestroyStreamProc(FUNC)    \
00280     ((NPP_DestroyStreamUPP) (FUNC))
00281 #define CallNPP_DestroyStreamProc(FUNC,  NPParg, NPStreamPtr, NPReasonArg)    \
00282     (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
00283 
00284 #endif
00285 
00286 
00287 /* NPP_WriteReady */
00288 
00289 #if _NPUPP_USE_UPP_
00290 
00291 typedef UniversalProcPtr NPP_WriteReadyUPP;
00292 enum {
00293   uppNPP_WriteReadyProcInfo = kThinkCStackBased
00294     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00295     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00296     | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00297 };
00298 #define NewNPP_WriteReadyProc(FUNC)   \
00299     (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
00300 #define CallNPP_WriteReadyProc(FUNC,  NPParg, NPStreamPtr)    \
00301     (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
00302 
00303 #else
00304 
00305 typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
00306 #define NewNPP_WriteReadyProc(FUNC)   \
00307     ((NPP_WriteReadyUPP) (FUNC))
00308 #define CallNPP_WriteReadyProc(FUNC,  NPParg, NPStreamPtr)    \
00309     (*(FUNC))((NPParg), (NPStreamPtr))
00310 
00311 #endif
00312 
00313 
00314 /* NPP_Write */
00315 
00316 #if _NPUPP_USE_UPP_
00317 
00318 typedef UniversalProcPtr NPP_WriteUPP;
00319 enum {
00320   uppNPP_WriteProcInfo = kThinkCStackBased
00321     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00322     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00323     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
00324     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
00325     | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
00326     | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00327 };
00328 #define NewNPP_WriteProc(FUNC)    \
00329     (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
00330 #define CallNPP_WriteProc(FUNC,  NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr)   \
00331     (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
00332 
00333 #else
00334 
00335 typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
00336 #define NewNPP_WriteProc(FUNC)    \
00337     ((NPP_WriteUPP) (FUNC))
00338 #define CallNPP_WriteProc(FUNC,  NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr)   \
00339     (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
00340 
00341 #endif
00342 
00343 
00344 /* NPP_StreamAsFile */
00345 
00346 #if _NPUPP_USE_UPP_
00347 
00348 typedef UniversalProcPtr NPP_StreamAsFileUPP;
00349 enum {
00350   uppNPP_StreamAsFileProcInfo = kThinkCStackBased
00351     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00352     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00353     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
00354     | RESULT_SIZE(SIZE_CODE(0))
00355 };
00356 #define NewNPP_StreamAsFileProc(FUNC)   \
00357     (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
00358 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3)    \
00359     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
00360 
00361 #else
00362  #ifndef __SYMBIAN32__
00363   typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
00364   #define NewNPP_StreamAsFileProc(FUNC)   \
00365       ((NPP_StreamAsFileUPP) (FUNC))
00366   #define CallNPP_StreamAsFileProc(FUNC,  ARG1, ARG2, ARG3)   \
00367       (*(FUNC))((ARG1), (ARG2), (ARG3))
00368  #else/* __SYMBIAN32__ */
00369 void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00370                                    const TDesC& fname);
00371   typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream,
00372                                    const TDesC& fname);
00373   #define NewNPP_StreamAsFileProc(FUNC)   \
00374       ((NPP_StreamAsFileUPP) (FUNC))
00375   #define CallNPP_StreamAsFileProc(FUNC,  ARG1, ARG2, ARG3)   \
00376       (*(FUNC))((ARG1), (ARG2), (ARG3))
00377  #endif /* __SYMBIAN32__ */
00378 
00379 #endif
00380 
00381 
00382 /* NPP_Print */
00383 
00384 #if _NPUPP_USE_UPP_
00385 
00386 typedef UniversalProcPtr NPP_PrintUPP;
00387 enum {
00388   uppNPP_PrintProcInfo = kThinkCStackBased
00389     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00390     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
00391     | RESULT_SIZE(SIZE_CODE(0))
00392 };
00393 #define NewNPP_PrintProc(FUNC)    \
00394     (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
00395 #define CallNPP_PrintProc(FUNC,  NPParg, voidPtr)   \
00396     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
00397 
00398 #else
00399 
00400 typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
00401 #define NewNPP_PrintProc(FUNC)    \
00402     ((NPP_PrintUPP) (FUNC))
00403 #define CallNPP_PrintProc(FUNC,  NPParg, NPPrintArg)    \
00404     (*(FUNC))((NPParg), (NPPrintArg))
00405 
00406 #endif
00407 
00408 
00409 /* NPP_HandleEvent */
00410 
00411 #if _NPUPP_USE_UPP_
00412 
00413 typedef UniversalProcPtr NPP_HandleEventUPP;
00414 enum {
00415   uppNPP_HandleEventProcInfo = kThinkCStackBased
00416     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00417     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
00418     | RESULT_SIZE(SIZE_CODE(sizeof(int16)))
00419 };
00420 #define NewNPP_HandleEventProc(FUNC)    \
00421     (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
00422 #define CallNPP_HandleEventProc(FUNC,  NPParg, voidPtr)   \
00423     (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
00424 
00425 #else
00426 
00427 typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
00428 #define NewNPP_HandleEventProc(FUNC)    \
00429     ((NPP_HandleEventUPP) (FUNC))
00430 #define CallNPP_HandleEventProc(FUNC,  NPParg, voidPtr)   \
00431     (*(FUNC))((NPParg), (voidPtr))
00432 
00433 #endif
00434 
00435 
00436 /* NPP_URLNotify */
00437 
00438 #if _NPUPP_USE_UPP_
00439 
00440 typedef UniversalProcPtr NPP_URLNotifyUPP;
00441 enum {
00442   uppNPP_URLNotifyProcInfo = kThinkCStackBased
00443     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00444     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00445     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00446     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00447     | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
00448 };
00449 #define NewNPP_URLNotifyProc(FUNC)    \
00450     (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
00451 #define CallNPP_URLNotifyProc(FUNC,  ARG1, ARG2, ARG3, ARG4)    \
00452     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
00453 
00454 #else
00455  #ifndef __SYMBIAN32__
00456   typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
00457   #define NewNPP_URLNotifyProc(FUNC)    \
00458       ((NPP_URLNotifyUPP) (FUNC))
00459   #define CallNPP_URLNotifyProc(FUNC,  ARG1, ARG2, ARG3, ARG4)    \
00460       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00461  #else/* __SYMBIAN32__ */
00462   typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const TDesC& url,
00463                                 NPReason reason, void* notifyData);
00464   #define NewNPP_URLNotifyProc(FUNC)    \
00465       ((NPP_URLNotifyUPP) (FUNC))
00466   #define CallNPP_URLNotifyProc(FUNC,  ARG1, ARG2, ARG3, ARG4)    \
00467       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00468  #endif /* __SYMBIAN32__ */
00469 
00470 #endif
00471 
00472 
00473 /* NPP_GetValue */
00474 
00475 #if _NPUPP_USE_UPP_
00476 
00477 typedef UniversalProcPtr NPP_GetValueUPP;
00478 enum {
00479   uppNPP_GetValueProcInfo = kThinkCStackBased
00480     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00481     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
00482     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00483     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00484 };
00485 #define NewNPP_GetValueProc(FUNC)   \
00486     (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
00487 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
00488     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
00489 #else
00490 
00491 typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
00492 #define NewNPP_GetValueProc(FUNC)   \
00493     ((NPP_GetValueUPP) (FUNC))
00494 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3)    \
00495     (*(FUNC))((ARG1), (ARG2), (ARG3))
00496 #endif
00497 
00498 
00499 /* NPP_SetValue */
00500 
00501 #if _NPUPP_USE_UPP_
00502 
00503 typedef UniversalProcPtr NPP_SetValueUPP;
00504 enum {
00505   uppNPP_SetValueProcInfo = kThinkCStackBased
00506     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00507     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
00508     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00509     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00510 };
00511 #define NewNPP_SetValueProc(FUNC)   \
00512     (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
00513 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
00514     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
00515 #else
00516 
00517 typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
00518 #define NewNPP_SetValueProc(FUNC)   \
00519     ((NPP_SetValueUPP) (FUNC))
00520 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3)    \
00521     (*(FUNC))((ARG1), (ARG2), (ARG3))
00522 #endif
00523 
00524 
00525 
00526 
00527 /*
00528  *  Netscape entry points
00529  */
00530 
00531 
00532 /* NPN_GetValue */
00533 
00534 #if _NPUPP_USE_UPP_
00535 
00536 typedef UniversalProcPtr NPN_GetValueUPP;
00537 enum {
00538   uppNPN_GetValueProcInfo = kThinkCStackBased
00539     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00540     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
00541     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00542     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00543 };
00544 #define NewNPN_GetValueProc(FUNC)   \
00545     (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
00546 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
00547     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
00548 #else
00549 
00550 typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
00551 #define NewNPN_GetValueProc(FUNC)   \
00552     ((NPN_GetValueUPP) (FUNC))
00553 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3)    \
00554     (*(FUNC))((ARG1), (ARG2), (ARG3))
00555 #endif
00556 
00557 
00558 /* NPN_SetValue */
00559 
00560 #if _NPUPP_USE_UPP_
00561 
00562 typedef UniversalProcPtr NPN_SetValueUPP;
00563 enum {
00564   uppNPN_SetValueProcInfo = kThinkCStackBased
00565     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00566     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
00567     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00568     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00569 };
00570 #define NewNPN_SetValueProc(FUNC)   \
00571     (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
00572 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
00573     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
00574 #else
00575 
00576 typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
00577 #define NewNPN_SetValueProc(FUNC)   \
00578     ((NPN_SetValueUPP) (FUNC))
00579 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3)    \
00580     (*(FUNC))((ARG1), (ARG2), (ARG3))
00581 #endif
00582 
00583 
00584 /* NPN_GetUrlNotify */
00585 
00586 #if _NPUPP_USE_UPP_
00587 
00588 typedef UniversalProcPtr NPN_GetURLNotifyUPP;
00589 enum {
00590   uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
00591     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00592     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00593     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00594     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00595     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00596 };
00597 #define NewNPN_GetURLNotifyProc(FUNC)   \
00598     (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
00599 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
00600     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
00601 #else
00602  #ifndef __SYMBIAN32__
00603   typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
00604   #define NewNPN_GetURLNotifyProc(FUNC)   \
00605       ((NPN_GetURLNotifyUPP) (FUNC))
00606   #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4)    \
00607       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00608  #else/* __SYMBIAN32__ */
00609   typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const TDesC& url,
00610                                    const TDesC* target, void* notifyData);
00611   #define NewNPN_GetURLNotifyProc(FUNC)   \
00612       ((NPN_GetURLNotifyUPP) (FUNC))
00613   #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4)    \
00614       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00615  #endif /* __SYMBIAN32__ */
00616 
00617 #endif
00618 
00619 
00620 /* NPN_PostUrlNotify */
00621 
00622 #if _NPUPP_USE_UPP_
00623 
00624 typedef UniversalProcPtr NPN_PostURLNotifyUPP;
00625 enum {
00626   uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
00627     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00628     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00629     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00630     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
00631     | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
00632     | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
00633     | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
00634     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00635 };
00636 #define NewNPN_PostURLNotifyProc(FUNC)    \
00637     (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
00638 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00639     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00640 #else
00641  #ifndef __SYMBIAN32__
00642   typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
00643   #define NewNPN_PostURLNotifyProc(FUNC)    \
00644       ((NPN_PostURLNotifyUPP) (FUNC))
00645   #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00646       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00647  #else/* __SYMBIAN32__ */
00648   typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const TDesC& url,
00649                                     const TDesC* target,
00650                                     const TDesC& buf, NPBool file,
00651                                     void* notifyData);
00652   #define NewNPN_PostURLNotifyProc(FUNC)    \
00653       ((NPN_PostURLNotifyUPP) (FUNC))
00654   #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00655       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00656  #endif /* __SYMBIAN32__ */
00657 
00658 
00659 #endif
00660 
00661 
00662 /* NPN_GetUrl */
00663 
00664 #if _NPUPP_USE_UPP_
00665 
00666 typedef UniversalProcPtr NPN_GetURLUPP;
00667 enum {
00668   uppNPN_GetURLProcInfo = kThinkCStackBased
00669     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00670     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00671     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00672     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00673 };
00674 #define NewNPN_GetURLProc(FUNC)   \
00675     (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
00676 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
00677     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
00678 #else
00679  #ifndef __SYMBIAN32__
00680   typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
00681   #define NewNPN_GetURLProc(FUNC)   \
00682       ((NPN_GetURLUPP) (FUNC))
00683   #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3)    \
00684       (*(FUNC))((ARG1), (ARG2), (ARG3))
00685  #else/* __SYMBIAN32__ */
00686   typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const TDesC& url,
00687                              const TDesC* target);
00688   #define NewNPN_GetURLProc(FUNC)   \
00689       ((NPN_GetURLUPP) (FUNC))
00690   #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3)    \
00691       (*(FUNC))((ARG1), (ARG2), (ARG3))
00692  #endif /* __SYMBIAN32__ */
00693 
00694 #endif
00695 
00696 
00697 /* NPN_PostUrl */
00698 
00699 #if _NPUPP_USE_UPP_
00700 
00701 typedef UniversalProcPtr NPN_PostURLUPP;
00702 enum {
00703   uppNPN_PostURLProcInfo = kThinkCStackBased
00704     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00705     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00706     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00707     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
00708     | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
00709     | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
00710     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00711 };
00712 #define NewNPN_PostURLProc(FUNC)    \
00713     (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
00714 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00715     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00716 #else
00717  #ifndef __SYMBIAN32__
00718   typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
00719   #define NewNPN_PostURLProc(FUNC)    \
00720       ((NPN_PostURLUPP) (FUNC))
00721   #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00722       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00723  #else/* __SYMBIAN32__ */
00724   typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const TDesC& url,
00725                               const TDesC* target,
00726                               const TDesC& buf, NPBool file);
00727   #define NewNPN_PostURLProc(FUNC)    \
00728       ((NPN_PostURLUPP) (FUNC))
00729   #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
00730       (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
00731  #endif /* __SYMBIAN32__ */
00732 #endif
00733 
00734 
00735 /* NPN_RequestRead */
00736 
00737 #if _NPUPP_USE_UPP_
00738 
00739 typedef UniversalProcPtr NPN_RequestReadUPP;
00740 enum {
00741   uppNPN_RequestReadProcInfo = kThinkCStackBased
00742     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
00743     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
00744     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00745 };
00746 #define NewNPN_RequestReadProc(FUNC)    \
00747     (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
00748 #define CallNPN_RequestReadProc(FUNC,  stream, range)   \
00749     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
00750 
00751 #else
00752 
00753 typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
00754 #define NewNPN_RequestReadProc(FUNC)    \
00755     ((NPN_RequestReadUPP) (FUNC))
00756 #define CallNPN_RequestReadProc(FUNC, stream, range)    \
00757     (*(FUNC))((stream), (range))
00758 
00759 #endif
00760 
00761 
00762 /* NPN_NewStream */
00763 
00764 #if _NPUPP_USE_UPP_
00765 
00766 typedef UniversalProcPtr NPN_NewStreamUPP;
00767 enum {
00768   uppNPN_NewStreamProcInfo = kThinkCStackBased
00769     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00770     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
00771     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
00772     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
00773     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00774 };
00775 #define NewNPN_NewStreamProc(FUNC)    \
00776     (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
00777 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream)    \
00778     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) 
00779 
00780 #else
00781  #ifndef __SYMBIAN32__
00782   typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
00783   #define NewNPN_NewStreamProc(FUNC)    \
00784       ((NPN_NewStreamUPP) (FUNC))
00785   #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream)    \
00786       (*(FUNC))((npp), (type), (window), (stream))
00787  #else/* __SYMBIAN32__ */
00788   typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type,
00789                                 const TDesC* target, NPStream** stream);
00790   #define NewNPN_NewStreamProc(FUNC)    \
00791       ((NPN_NewStreamUPP) (FUNC))
00792   #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream)    \
00793       (*(FUNC))((npp), (type), (window), (stream))
00794  #endif /* __SYMBIAN32__ */
00795 
00796 
00797 #endif
00798 
00799 
00800 /* NPN_Write */
00801 
00802 #if _NPUPP_USE_UPP_
00803 
00804 typedef UniversalProcPtr NPN_WriteUPP;
00805 enum {
00806   uppNPN_WriteProcInfo = kThinkCStackBased
00807     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00808     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00809     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
00810     | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00811     | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00812 };
00813 #define NewNPN_WriteProc(FUNC)    \
00814     (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
00815 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer)   \
00816     (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))  
00817 
00818 #else
00819 
00820 typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
00821 #define NewNPN_WriteProc(FUNC)    \
00822     ((NPN_WriteUPP) (FUNC))
00823 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer)   \
00824     (*(FUNC))((npp), (stream), (len), (buffer))
00825 
00826 #endif
00827 
00828 
00829 /* NPN_DestroyStream */
00830 
00831 #if _NPUPP_USE_UPP_
00832 
00833 typedef UniversalProcPtr NPN_DestroyStreamUPP;
00834 enum {
00835   uppNPN_DestroyStreamProcInfo = kThinkCStackBased
00836     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
00837     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00838     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00839     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00840 };
00841 #define NewNPN_DestroyStreamProc(FUNC)    \
00842     (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
00843 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason)    \
00844     (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) 
00845 
00846 #else
00847 
00848 typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
00849 #define NewNPN_DestroyStreamProc(FUNC)    \
00850     ((NPN_DestroyStreamUPP) (FUNC))
00851 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason)    \
00852     (*(FUNC))((npp), (stream), (reason))
00853 
00854 #endif
00855 
00856 
00857 /* NPN_Status */
00858 
00859 #if _NPUPP_USE_UPP_
00860 
00861 typedef UniversalProcPtr NPN_StatusUPP;
00862 enum {
00863   uppNPN_StatusProcInfo = kThinkCStackBased
00864     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00865     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
00866 };
00867 
00868 #define NewNPN_StatusProc(FUNC)   \
00869     (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
00870 #define CallNPN_StatusProc(FUNC, npp, msg)    \
00871     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))  
00872 
00873 #else
00874  #ifndef __SYMBIAN32__
00875   typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
00876   #define NewNPN_StatusProc(FUNC)   \
00877       ((NPN_StatusUPP) (FUNC))
00878   #define CallNPN_StatusProc(FUNC, npp, msg)    \
00879       (*(FUNC))((npp), (msg)) 
00880  #else/* __SYMBIAN32__ */
00881   typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const TDesC& message);
00882   #define NewNPN_StatusProc(FUNC)   \
00883       ((NPN_StatusUPP) (FUNC))
00884   #define CallNPN_StatusProc(FUNC, npp, msg)    \
00885       (*(FUNC))((npp), (msg)) 
00886  #endif /* __SYMBIAN32__ */
00887 
00888 #endif
00889 
00890 
00891 /* NPN_UserAgent */
00892 #if _NPUPP_USE_UPP_
00893 
00894 typedef UniversalProcPtr NPN_UserAgentUPP;
00895 enum {
00896         uppNPN_UserAgentProcInfo = kThinkCStackBased
00897                 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00898                 | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
00899 };
00900 
00901 #define NewNPN_UserAgentProc(FUNC)              \
00902                 (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture())
00903 #define CallNPN_UserAgentProc(FUNC, ARG1)               \
00904                 (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1))
00905 
00906 #else
00907  #ifndef __SYMBIAN32__
00908   typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
00909   #define NewNPN_UserAgentProc(FUNC)              \
00910           ((NPN_UserAgentUPP) (FUNC))
00911   #define CallNPN_UserAgentProc(FUNC, ARG1)               \
00912           (*(FUNC))((ARG1))
00913  #else/* __SYMBIAN32__ */
00914   typedef const TDesC* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
00915   #define NewNPN_UserAgentProc(FUNC)              \
00916           ((NPN_UserAgentUPP) (FUNC))
00917   #define CallNPN_UserAgentProc(FUNC, ARG1)               \
00918           (*(FUNC))((ARG1))
00919  #endif /* __SYMBIAN32__ */
00920 
00921 #endif
00922 
00923 
00924 /* NPN_MemAlloc */
00925 #if _NPUPP_USE_UPP_
00926 
00927 typedef UniversalProcPtr NPN_MemAllocUPP;
00928 enum {
00929   uppNPN_MemAllocProcInfo = kThinkCStackBased
00930     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
00931     | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
00932 };
00933 
00934 #define NewNPN_MemAllocProc(FUNC)   \
00935     (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
00936 #define CallNPN_MemAllocProc(FUNC, ARG1)    \
00937     (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) 
00938 
00939 #else
00940 
00941 typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
00942 #define NewNPN_MemAllocProc(FUNC)   \
00943     ((NPN_MemAllocUPP) (FUNC))
00944 #define CallNPN_MemAllocProc(FUNC, ARG1)    \
00945     (*(FUNC))((ARG1)) 
00946 
00947 #endif
00948 
00949 
00950 /* NPN__MemFree */
00951 
00952 #if _NPUPP_USE_UPP_
00953 
00954 typedef UniversalProcPtr NPN_MemFreeUPP;
00955 enum {
00956   uppNPN_MemFreeProcInfo = kThinkCStackBased
00957     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
00958 };
00959 
00960 #define NewNPN_MemFreeProc(FUNC)    \
00961     (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
00962 #define CallNPN_MemFreeProc(FUNC, ARG1)   \
00963     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
00964 
00965 #else
00966 
00967 typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
00968 #define NewNPN_MemFreeProc(FUNC)    \
00969     ((NPN_MemFreeUPP) (FUNC))
00970 #define CallNPN_MemFreeProc(FUNC, ARG1)   \
00971     (*(FUNC))((ARG1)) 
00972 
00973 #endif
00974 
00975 
00976 /* NPN_MemFlush */
00977 
00978 #if _NPUPP_USE_UPP_
00979 
00980 typedef UniversalProcPtr NPN_MemFlushUPP;
00981 enum {
00982   uppNPN_MemFlushProcInfo = kThinkCStackBased
00983     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
00984     | RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
00985 };
00986 
00987 #define NewNPN_MemFlushProc(FUNC)   \
00988     (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
00989 #define CallNPN_MemFlushProc(FUNC, ARG1)    \
00990     (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))  
00991 
00992 #else
00993 
00994 typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
00995 #define NewNPN_MemFlushProc(FUNC)   \
00996     ((NPN_MemFlushUPP) (FUNC))
00997 #define CallNPN_MemFlushProc(FUNC, ARG1)    \
00998     (*(FUNC))((ARG1)) 
00999 
01000 #endif
01001 
01002 
01003 
01004 /* NPN_ReloadPlugins */
01005 
01006 #if _NPUPP_USE_UPP_
01007 
01008 typedef UniversalProcPtr NPN_ReloadPluginsUPP;
01009 enum {
01010   uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
01011     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
01012     | RESULT_SIZE(SIZE_CODE(0))
01013 };
01014 
01015 #define NewNPN_ReloadPluginsProc(FUNC)    \
01016     (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
01017 #define CallNPN_ReloadPluginsProc(FUNC, ARG1)   \
01018     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) 
01019 
01020 #else
01021 
01022 typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
01023 #define NewNPN_ReloadPluginsProc(FUNC)    \
01024     ((NPN_ReloadPluginsUPP) (FUNC))
01025 #define CallNPN_ReloadPluginsProc(FUNC, ARG1)   \
01026     (*(FUNC))((ARG1)) 
01027 
01028 #endif
01029 
01030 #ifdef JRI_H
01031 /* NPN_GetJavaEnv */
01032 
01033 #if _NPUPP_USE_UPP_
01034 
01035 typedef UniversalProcPtr NPN_GetJavaEnvUPP;
01036 enum {
01037   uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
01038     | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
01039 };
01040 
01041 #define NewNPN_GetJavaEnvProc(FUNC)   \
01042     (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
01043 #define CallNPN_GetJavaEnvProc(FUNC)    \
01044     (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) 
01045 
01046 #else
01047 typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
01048 #define NewNPN_GetJavaEnvProc(FUNC)   \
01049     ((NPN_GetJavaEnvUPP) (FUNC))
01050 #define CallNPN_GetJavaEnvProc(FUNC)    \
01051     (*(FUNC))() 
01052 
01053 #endif
01054 
01055 
01056 /* NPN_GetJavaPeer */
01057 
01058 #if _NPUPP_USE_UPP_
01059 
01060 typedef UniversalProcPtr NPN_GetJavaPeerUPP;
01061 enum {
01062   uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
01063     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01064     | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
01065 };
01066 
01067 #define NewNPN_GetJavaPeerProc(FUNC)    \
01068     (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
01069 #define CallNPN_GetJavaPeerProc(FUNC, ARG1)   \
01070     (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) 
01071 
01072 #else
01073 
01074 typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
01075 #define NewNPN_GetJavaPeerProc(FUNC)    \
01076     ((NPN_GetJavaPeerUPP) (FUNC))
01077 #define CallNPN_GetJavaPeerProc(FUNC, ARG1)   \
01078     (*(FUNC))((ARG1)) 
01079 
01080 #endif
01081 
01082 #else//#ifdef JRI_H
01083  typedef void JRIEnv;
01084  typedef void* JRIGlobalRef;
01085  typedef void* jref;
01086  typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void);
01087  #define NewNPN_GetJavaEnvProc(FUNC)   \
01088     ((NPN_GetJavaEnvUPP) (FUNC))
01089  #define CallNPN_GetJavaEnvProc(FUNC)    \
01090     (*(FUNC))() 
01091  typedef jref (*NPN_GetJavaPeerUPP)(NPP instance);
01092  #define NewNPN_GetJavaPeerProc(FUNC)    \
01093     ((NPN_GetJavaPeerUPP) (FUNC))
01094  #define CallNPN_GetJavaPeerProc(FUNC, ARG1)   \
01095     (*(FUNC))((ARG1)) 
01096 #endif//#ifdef JRI_H
01097 
01098 /* NPN_InvalidateRect */
01099 
01100 #if _NPUPP_USE_UPP_
01101 
01102 typedef UniversalProcPtr NPN_InvalidateRectUPP;
01103 enum {
01104   uppNPN_InvalidateRectProcInfo = kThinkCStackBased
01105     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01106     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
01107     | RESULT_SIZE(SIZE_CODE(0))
01108 };
01109 
01110 #define NewNPN_InvalidateRectProc(FUNC)   \
01111     (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
01112 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2)    \
01113     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))  
01114 
01115 #else
01116 
01117 typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
01118 #define NewNPN_InvalidateRectProc(FUNC)   \
01119     ((NPN_InvalidateRectUPP) (FUNC))
01120 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2)    \
01121     (*(FUNC))((ARG1), (ARG2)) 
01122 
01123 #endif
01124 
01125 
01126 /* NPN_InvalidateRegion */
01127 
01128 #if _NPUPP_USE_UPP_
01129 
01130 typedef UniversalProcPtr NPN_InvalidateRegionUPP;
01131 enum {
01132   uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
01133     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01134     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
01135     | RESULT_SIZE(SIZE_CODE(0))
01136 };
01137 
01138 #define NewNPN_InvalidateRegionProc(FUNC)   \
01139     (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
01140 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2)    \
01141     (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))  
01142 
01143 #else
01144 
01145 typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
01146 #define NewNPN_InvalidateRegionProc(FUNC)   \
01147     ((NPN_InvalidateRegionUPP) (FUNC))
01148 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2)    \
01149     (*(FUNC))((ARG1), (ARG2)) 
01150 
01151 #endif
01152 
01153 /* NPN_ForceRedraw */
01154 
01155 #if _NPUPP_USE_UPP_
01156 
01157 typedef UniversalProcPtr NPN_ForceRedrawUPP;
01158 enum {
01159   uppNPN_ForceRedrawProcInfo = kThinkCStackBased
01160     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01161     | RESULT_SIZE(SIZE_CODE(sizeof(0)))
01162 };
01163 
01164 #define NewNPN_ForceRedrawProc(FUNC)    \
01165     (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
01166 #define CallNPN_ForceRedrawProc(FUNC, ARG1)   \
01167     (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1)) 
01168 
01169 #else
01170 
01171 typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance);
01172 #define NewNPN_ForceRedrawProc(FUNC)    \
01173     ((NPN_ForceRedrawUPP) (FUNC))
01174 #define CallNPN_ForceRedrawProc(FUNC, ARG1)   \
01175     (*(FUNC))((ARG1)) 
01176 
01177 #endif
01178 
01179 
01180 /******************************************************************************************
01181  * The actual plugin function table definitions
01182  *******************************************************************************************/
01183 
01184 #ifdef XP_MAC
01185 #if PRAGMA_STRUCT_ALIGN
01186 #pragma options align=mac68k
01187 #endif
01188 #endif
01189 
01190 typedef struct _NPPluginFuncs {
01191     uint16 size;
01192     uint16 version;
01193     NPP_NewUPP newp;
01194     NPP_DestroyUPP destroy;
01195     NPP_SetWindowUPP setwindow;
01196     NPP_NewStreamUPP newstream;
01197     NPP_DestroyStreamUPP destroystream;
01198     NPP_StreamAsFileUPP asfile;
01199     NPP_WriteReadyUPP writeready;
01200     NPP_WriteUPP write;
01201     NPP_PrintUPP print;
01202     NPP_HandleEventUPP event;
01203     NPP_URLNotifyUPP urlnotify;
01204     JRIGlobalRef javaClass;
01205     NPP_GetValueUPP getvalue;
01206     NPP_SetValueUPP setvalue;
01207 } NPPluginFuncs;
01208 
01209 typedef struct _NPNetscapeFuncs {
01210     uint16 size;
01211     uint16 version;
01212     NPN_GetURLUPP geturl;
01213     NPN_PostURLUPP posturl;
01214     NPN_RequestReadUPP requestread;
01215     NPN_NewStreamUPP newstream;
01216     NPN_WriteUPP write;
01217     NPN_DestroyStreamUPP destroystream;
01218     NPN_StatusUPP status;
01219     NPN_UserAgentUPP uagent;
01220     NPN_MemAllocUPP memalloc;
01221     NPN_MemFreeUPP memfree;
01222     NPN_MemFlushUPP memflush;
01223     NPN_ReloadPluginsUPP reloadplugins;
01224     NPN_GetJavaEnvUPP getJavaEnv;
01225     NPN_GetJavaPeerUPP getJavaPeer;
01226     NPN_GetURLNotifyUPP geturlnotify;
01227     NPN_PostURLNotifyUPP posturlnotify;
01228     NPN_GetValueUPP getvalue;
01229     NPN_SetValueUPP setvalue;
01230     NPN_InvalidateRectUPP invalidaterect;
01231     NPN_InvalidateRegionUPP invalidateregion;
01232     NPN_ForceRedrawUPP forceredraw;
01233 } NPNetscapeFuncs;
01234 
01235 #ifdef XP_MAC
01236 #if PRAGMA_STRUCT_ALIGN
01237 #pragma options align=reset
01238 #endif
01239 #endif
01240 
01241 
01242 #if defined(XP_MAC) || defined(XP_MACOSX)
01243 /******************************************************************************************
01244  * Mac platform-specific plugin glue stuff
01245  *******************************************************************************************/
01246 
01247 /*
01248  * Main entry point of the plugin.
01249  * This routine will be called when the plugin is loaded. The function
01250  * tables are passed in and the plugin fills in the NPPluginFuncs table
01251  * and NPPShutdownUPP for Netscape's use.
01252  */
01253 
01254 #if _NPUPP_USE_UPP_
01255 
01256 typedef UniversalProcPtr NPP_MainEntryUPP;
01257 enum {
01258   uppNPP_MainEntryProcInfo = kThinkCStackBased
01259     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
01260     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
01261     | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
01262     | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
01263 };
01264 #define NewNPP_MainEntryProc(FUNC)    \
01265     (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
01266 #define CallNPP_MainEntryProc(FUNC,  netscapeFunc, pluginFunc, shutdownUPP)   \
01267     CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
01268 
01269 #else
01270 
01271 typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
01272 #define NewNPP_MainEntryProc(FUNC)    \
01273     ((NPP_MainEntryUPP) (FUNC))
01274 #define CallNPP_MainEntryProc(FUNC,  netscapeFunc, pluginFunc, shutdownUPP)   \
01275     (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
01276 
01277 #endif
01278 
01279 
01280 /*
01281  * Mac version(s) of NP_GetMIMEDescription(const char *)
01282  * These can be called to retreive MIME information from the plugin dynamically
01283  *
01284  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
01285  *       to get mime info from the plugin only on OSX and may not be supported 
01286  *       in furture version--use NP_GetMIMEDescription instead
01287  */
01288 
01289 enum
01290 {
01291  kBPSupportedMIMETypesStructVers_1    = 1
01292 };
01293 
01294 typedef struct _BPSupportedMIMETypes
01295 {
01296  SInt32    structVersion;      /* struct version */
01297  Handle    typeStrings;        /* STR# formated handle, allocated by plug-in */
01298  Handle    infoStrings;        /* STR# formated handle, allocated by plug-in */
01299 } BPSupportedMIMETypes;
01300 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
01301 
01302 #if _NPUPP_USE_UPP_
01303 
01304 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD"
01305 typedef UniversalProcPtr NP_GetMIMEDescriptionUPP;
01306 enum {
01307   uppNP_GetMIMEDescEntryProc = kThinkCStackBased
01308     | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
01309 };
01310 #define NewNP_GetMIMEDescEntryProc(FUNC)    \
01311     (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture())
01312 #define CallNP_GetMIMEDescEntryProc(FUNC)   \
01313     (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc)
01314 
01315 
01316 #else  /* !_NPUPP_USE_UPP_ */
01317  #ifndef __SYMBIAN32__
01318   typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
01319  #else/* __SYMBIAN32__ */
01320   typedef const TDesC* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
01321  #endif /* __SYMBIAN32__ */
01322 
01323  /* NP_GetMIMEDescription */
01324 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
01325 #define NewNP_GetMIMEDescEntryProc(FUNC)    \
01326     ((NP_GetMIMEDescriptionUPP) (FUNC))
01327 #define CallNP_GetMIMEDescEntryProc(FUNC)   \
01328     (*(FUNC))()
01329 /* BP_GetSupportedMIMETypes */
01330 typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32);
01331 #define NewBP_GetSupportedMIMETypesEntryProc(FUNC)    \
01332     ((BP_GetSupportedMIMETypesUPP) (FUNC))
01333 #define CallBP_GetMIMEDescEntryProc(FUNC,  mimeInfo, flags)   \
01334     (*(FUNC))((mimeInfo), (flags))
01335 
01336 #endif
01337 #endif /* MAC */
01338 
01339 #if defined(_WINDOWS)
01340 #define OSCALL WINAPI
01341 #else
01342 #if defined(__OS2__)
01343 #define OSCALL _System
01344 #else
01345 #define OSCALL
01346 #endif
01347 #endif
01348 
01349 #if defined( _WINDOWS ) || defined (__OS2__)
01350 
01351 #ifndef __SYMBIAN32__
01352  #ifdef __cplusplus
01353  extern "C" {
01354  #endif
01355 #endif
01356 
01357 /* plugin meta member functions */
01358 #if defined(__OS2__)
01359 
01360 typedef struct _NPPluginData {   /* Alternate OS2 Plugin interface */
01361     char *pMimeTypes;
01362     char *pFileExtents;
01363     char *pFileOpenTemplate;
01364     char *pProductName;
01365     char *pProductDescription;
01366     unsigned long dwProductVersionMS;
01367     unsigned long dwProductVersionLS;
01368 } NPPluginData;
01369 
01370 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
01371 
01372 #endif
01373 
01374 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
01375 
01376 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs);
01377 
01378 NPError OSCALL NP_Shutdown();
01379 
01380 char* NP_GetMIMEDescription();
01381 
01382 #ifndef __SYMBIAN32__
01383  #ifdef __cplusplus
01384  }
01385  #endif
01386 #endif
01387 
01388 #endif /* _WINDOWS || __OS2__ */
01389 
01390 #if defined(__OS2__)
01391 #pragma pack()
01392 #endif
01393 
01394 #ifdef XP_UNIX
01395 
01396 #ifndef __SYMBIAN32__
01397  #ifdef __cplusplus
01398  extern "C" {
01399  #endif
01400 #endif
01401 
01402 /* plugin meta member functions */
01403 #ifndef __SYMBIAN32__
01404 char* NP_GetMIMEDescription(void);
01405 NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
01406 NPError NP_Shutdown(void);
01407 NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
01408 #else
01409 IMPORT_C const TDesC* NP_GetMIMEDescription(void);
01410 IMPORT_C NPError    NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
01411 IMPORT_C void     NP_Shutdown(void);
01412 IMPORT_C NPError    NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
01413 #endif /* __SYMBIAN32__ */
01414 
01415 #ifndef __SYMBIAN32__
01416  #ifdef __cplusplus
01417  }
01418  #endif
01419 #endif
01420 
01421 #endif /* XP_UNIX */
01422 
01423 #endif /* _NPUPP_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top