OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ |
| 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 * |
| 24 * Alternatively, the contents of this file may be used under the terms of |
| 25 * either the GNU General Public License Version 2 or later (the "GPL"), or |
| 26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 27 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 28 * of those above. If you wish to allow use of your version of this file only |
| 29 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 30 * use your version of this file under the terms of the MPL, indicate your |
| 31 * decision by deleting the provisions above and replace them with the notice |
| 32 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 33 * the provisions above, a recipient may use your version of this file under |
| 34 * the terms of any one of the MPL, the GPL or the LGPL. |
| 35 * |
| 36 * ***** END LICENSE BLOCK ***** */ |
| 37 |
| 38 |
| 39 /* |
| 40 * npupp.h $Revision: 3.20 $ |
| 41 * function call mecahnics needed by platform specific glue code. |
| 42 */ |
| 43 |
| 44 |
| 45 #ifndef _NPUPP_H_ |
| 46 #define _NPUPP_H_ |
| 47 |
| 48 #if defined(__OS2__) |
| 49 #pragma pack(1) |
| 50 #endif |
| 51 |
| 52 #ifndef GENERATINGCFM |
| 53 #define GENERATINGCFM 0 |
| 54 #endif |
| 55 |
| 56 #ifndef _NPAPI_H_ |
| 57 #include "npapi.h" |
| 58 #endif |
| 59 |
| 60 #include "npruntime.h" |
| 61 |
| 62 #include "jri.h" |
| 63 |
| 64 /*******************************************************************************
*********** |
| 65 plug-in function table macros |
| 66 for each function in and out of the plugin API we define |
| 67 typedef NPP_FooUPP |
| 68 #define NewNPP_FooProc |
| 69 #define CallNPP_FooProc |
| 70 for mac, define the UPP magic for PPC/68K calling |
| 71 *******************************************************************************
************/ |
| 72 |
| 73 |
| 74 /* NPP_Initialize */ |
| 75 |
| 76 #define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON) |
| 77 |
| 78 #if _NPUPP_USE_UPP_ |
| 79 typedef UniversalProcPtr NPP_InitializeUPP; |
| 80 |
| 81 enum { |
| 82 uppNPP_InitializeProcInfo = kThinkCStackBased |
| 83 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) |
| 84 | RESULT_SIZE(SIZE_CODE(0)) |
| 85 }; |
| 86 |
| 87 #define NewNPP_InitializeProc(FUNC) \ |
| 88 (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP
_InitializeProcInfo, GetCurrentArchitecture()) |
| 89 #define CallNPP_InitializeProc(FUNC) \ |
| 90 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_Initial
izeProcInfo) |
| 91 |
| 92 #else |
| 93 |
| 94 typedef void (* NP_LOADDS NPP_InitializeUPP)(void); |
| 95 #define NewNPP_InitializeProc(FUNC) \ |
| 96 ((NPP_InitializeUPP) (FUNC)) |
| 97 #define CallNPP_InitializeProc(FUNC) \ |
| 98 (*(FUNC))() |
| 99 |
| 100 #endif |
| 101 |
| 102 |
| 103 /* NPP_Shutdown */ |
| 104 |
| 105 #if _NPUPP_USE_UPP_ |
| 106 typedef UniversalProcPtr NPP_ShutdownUPP; |
| 107 |
| 108 enum { |
| 109 uppNPP_ShutdownProcInfo = kThinkCStackBased |
| 110 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) |
| 111 | RESULT_SIZE(SIZE_CODE(0)) |
| 112 }; |
| 113 |
| 114 #define NewNPP_ShutdownProc(FUNC) \ |
| 115 (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_S
hutdownProcInfo, GetCurrentArchitecture()) |
| 116 #define CallNPP_ShutdownProc(FUNC) \ |
| 117 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_Shutdow
nProcInfo) |
| 118 |
| 119 #else |
| 120 |
| 121 typedef void (* NP_LOADDS NPP_ShutdownUPP)(void); |
| 122 #define NewNPP_ShutdownProc(FUNC) \ |
| 123 ((NPP_ShutdownUPP) (FUNC)) |
| 124 #define CallNPP_ShutdownProc(FUNC) \ |
| 125 (*(FUNC))() |
| 126 |
| 127 #endif |
| 128 |
| 129 |
| 130 /* NPP_New */ |
| 131 |
| 132 #if _NPUPP_USE_UPP_ |
| 133 typedef UniversalProcPtr NPP_NewUPP; |
| 134 |
| 135 enum { |
| 136 uppNPP_NewProcInfo = kThinkCStackBased |
| 137 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) |
| 138 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) |
| 139 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) |
| 140 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) |
| 141 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) |
| 142 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) |
| 143 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) |
| 144 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 145 }; |
| 146 |
| 147 #define NewNPP_NewProc(FUNC) \ |
| 148 (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewPro
cInfo, GetCurrentArchitecture()) |
| 149 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ |
| 150 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewP
rocInfo, \ |
| 151 (ARG1), (ARG2
), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
| 152 #else |
| 153 |
| 154 typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, ui
nt16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); |
| 155 #define NewNPP_NewProc(FUNC) \ |
| 156 ((NPP_NewUPP) (FUNC)) |
| 157 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)
\ |
| 158 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)
) |
| 159 |
| 160 #endif |
| 161 |
| 162 |
| 163 /* NPP_Destroy */ |
| 164 |
| 165 #if _NPUPP_USE_UPP_ |
| 166 |
| 167 typedef UniversalProcPtr NPP_DestroyUPP; |
| 168 enum { |
| 169 uppNPP_DestroyProcInfo = kThinkCStackBased |
| 170 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 171 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) |
| 172 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 173 }; |
| 174 #define NewNPP_DestroyProc(FUNC) \ |
| 175 (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_De
stroyProcInfo, GetCurrentArchitecture()) |
| 176 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ |
| 177 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_Dest
royProcInfo, (ARG1), (ARG2)) |
| 178 #else |
| 179 |
| 180 typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save); |
| 181 #define NewNPP_DestroyProc(FUNC) \ |
| 182 ((NPP_DestroyUPP) (FUNC)) |
| 183 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ |
| 184 (*(FUNC))((ARG1), (ARG2)) |
| 185 |
| 186 #endif |
| 187 |
| 188 |
| 189 /* NPP_SetWindow */ |
| 190 |
| 191 #if _NPUPP_USE_UPP_ |
| 192 |
| 193 typedef UniversalProcPtr NPP_SetWindowUPP; |
| 194 enum { |
| 195 uppNPP_SetWindowProcInfo = kThinkCStackBased |
| 196 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 197 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) |
| 198 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 199 }; |
| 200 #define NewNPP_SetWindowProc(FUNC) \ |
| 201 (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_
SetWindowProcInfo, GetCurrentArchitecture()) |
| 202 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ |
| 203 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetW
indowProcInfo, (ARG1), (ARG2)) |
| 204 |
| 205 #else |
| 206 |
| 207 typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window); |
| 208 #define NewNPP_SetWindowProc(FUNC) \ |
| 209 ((NPP_SetWindowUPP) (FUNC)) |
| 210 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ |
| 211 (*(FUNC))((ARG1), (ARG2)) |
| 212 |
| 213 #endif |
| 214 |
| 215 |
| 216 /* NPP_NewStream */ |
| 217 |
| 218 #if _NPUPP_USE_UPP_ |
| 219 |
| 220 typedef UniversalProcPtr NPP_NewStreamUPP; |
| 221 enum { |
| 222 uppNPP_NewStreamProcInfo = kThinkCStackBased |
| 223 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 224 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) |
| 225 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) |
| 226 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) |
| 227 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) |
| 228 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 229 }; |
| 230 #define NewNPP_NewStreamProc(FUNC) \ |
| 231 (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_
NewStreamProcInfo, GetCurrentArchitecture()) |
| 232 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)
\ |
| 233 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewS
treamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
| 234 #else |
| 235 |
| 236 typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NP
Stream* stream, NPBool seekable, uint16* stype); |
| 237 #define NewNPP_NewStreamProc(FUNC) \ |
| 238 ((NPP_NewStreamUPP) (FUNC)) |
| 239 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ |
| 240 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
| 241 #endif |
| 242 |
| 243 |
| 244 /* NPP_DestroyStream */ |
| 245 |
| 246 #if _NPUPP_USE_UPP_ |
| 247 |
| 248 typedef UniversalProcPtr NPP_DestroyStreamUPP; |
| 249 enum { |
| 250 uppNPP_DestroyStreamProcInfo = kThinkCStackBased |
| 251 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 252 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 253 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
| 254 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 255 }; |
| 256 #define NewNPP_DestroyStreamProc(FUNC) \ |
| 257 (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPP_DestroyStreamProcInfo, GetCurrentArchitecture()) |
| 258 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg)
\ |
| 259 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_Dest
royStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) |
| 260 |
| 261 #else |
| 262 |
| 263 typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* strea
m, NPReason reason); |
| 264 #define NewNPP_DestroyStreamProc(FUNC) \ |
| 265 ((NPP_DestroyStreamUPP) (FUNC)) |
| 266 #define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg)
\ |
| 267 (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) |
| 268 |
| 269 #endif |
| 270 |
| 271 |
| 272 /* NPP_WriteReady */ |
| 273 |
| 274 #if _NPUPP_USE_UPP_ |
| 275 |
| 276 typedef UniversalProcPtr NPP_WriteReadyUPP; |
| 277 enum { |
| 278 uppNPP_WriteReadyProcInfo = kThinkCStackBased |
| 279 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 280 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 281 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
| 282 }; |
| 283 #define NewNPP_WriteReadyProc(FUNC) \ |
| 284 (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP
_WriteReadyProcInfo, GetCurrentArchitecture()) |
| 285 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ |
| 286 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteR
eadyProcInfo, (NPParg), (NPStreamPtr)) |
| 287 |
| 288 #else |
| 289 |
| 290 typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream); |
| 291 #define NewNPP_WriteReadyProc(FUNC) \ |
| 292 ((NPP_WriteReadyUPP) (FUNC)) |
| 293 #define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ |
| 294 (*(FUNC))((NPParg), (NPStreamPtr)) |
| 295 |
| 296 #endif |
| 297 |
| 298 |
| 299 /* NPP_Write */ |
| 300 |
| 301 #if _NPUPP_USE_UPP_ |
| 302 |
| 303 typedef UniversalProcPtr NPP_WriteUPP; |
| 304 enum { |
| 305 uppNPP_WriteProcInfo = kThinkCStackBased |
| 306 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 307 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 308 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) |
| 309 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) |
| 310 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) |
| 311 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
| 312 }; |
| 313 #define NewNPP_WriteProc(FUNC) \ |
| 314 (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_Writ
eProcInfo, GetCurrentArchitecture()) |
| 315 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferP
tr) \ |
| 316 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteP
rocInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) |
| 317 |
| 318 #else |
| 319 |
| 320 typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 o
ffset, int32 len, void* buffer); |
| 321 #define NewNPP_WriteProc(FUNC) \ |
| 322 ((NPP_WriteUPP) (FUNC)) |
| 323 #define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferP
tr) \ |
| 324 (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (buffe
rPtr)) |
| 325 |
| 326 #endif |
| 327 |
| 328 |
| 329 /* NPP_StreamAsFile */ |
| 330 |
| 331 #if _NPUPP_USE_UPP_ |
| 332 |
| 333 typedef UniversalProcPtr NPP_StreamAsFileUPP; |
| 334 enum { |
| 335 uppNPP_StreamAsFileProcInfo = kThinkCStackBased |
| 336 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 337 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 338 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) |
| 339 | RESULT_SIZE(SIZE_CODE(0)) |
| 340 }; |
| 341 #define NewNPP_StreamAsFileProc(FUNC) \ |
| 342 (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppN
PP_StreamAsFileProcInfo, GetCurrentArchitecture()) |
| 343 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ |
| 344 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamA
sFileProcInfo, (ARG1), (ARG2), (ARG3)) |
| 345 |
| 346 #else |
| 347 |
| 348 typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, c
onst char* fname); |
| 349 #define NewNPP_StreamAsFileProc(FUNC) \ |
| 350 ((NPP_StreamAsFileUPP) (FUNC)) |
| 351 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ |
| 352 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 353 #endif |
| 354 |
| 355 |
| 356 /* NPP_Print */ |
| 357 |
| 358 #if _NPUPP_USE_UPP_ |
| 359 |
| 360 typedef UniversalProcPtr NPP_PrintUPP; |
| 361 enum { |
| 362 uppNPP_PrintProcInfo = kThinkCStackBased |
| 363 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 364 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) |
| 365 | RESULT_SIZE(SIZE_CODE(0)) |
| 366 }; |
| 367 #define NewNPP_PrintProc(FUNC) \ |
| 368 (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_Prin
tProcInfo, GetCurrentArchitecture()) |
| 369 #define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ |
| 370 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintPr
ocInfo, (NPParg), (voidPtr)) |
| 371 |
| 372 #else |
| 373 |
| 374 typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); |
| 375 #define NewNPP_PrintProc(FUNC) \ |
| 376 ((NPP_PrintUPP) (FUNC)) |
| 377 #define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ |
| 378 (*(FUNC))((NPParg), (NPPrintArg)) |
| 379 |
| 380 #endif |
| 381 |
| 382 |
| 383 /* NPP_HandleEvent */ |
| 384 |
| 385 #if _NPUPP_USE_UPP_ |
| 386 |
| 387 typedef UniversalProcPtr NPP_HandleEventUPP; |
| 388 enum { |
| 389 uppNPP_HandleEventProcInfo = kThinkCStackBased |
| 390 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 391 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) |
| 392 | RESULT_SIZE(SIZE_CODE(sizeof(int16))) |
| 393 }; |
| 394 #define NewNPP_HandleEventProc(FUNC) \ |
| 395 (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
P_HandleEventProcInfo, GetCurrentArchitecture()) |
| 396 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ |
| 397 (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_Handle
EventProcInfo, (NPParg), (voidPtr)) |
| 398 |
| 399 #else |
| 400 |
| 401 typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event); |
| 402 #define NewNPP_HandleEventProc(FUNC) \ |
| 403 ((NPP_HandleEventUPP) (FUNC)) |
| 404 #define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ |
| 405 (*(FUNC))((NPParg), (voidPtr)) |
| 406 |
| 407 #endif |
| 408 |
| 409 |
| 410 /* NPP_URLNotify */ |
| 411 |
| 412 #if _NPUPP_USE_UPP_ |
| 413 |
| 414 typedef UniversalProcPtr NPP_URLNotifyUPP; |
| 415 enum { |
| 416 uppNPP_URLNotifyProcInfo = kThinkCStackBased |
| 417 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 418 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
| 419 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
| 420 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
| 421 | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) |
| 422 }; |
| 423 #define NewNPP_URLNotifyProc(FUNC) \ |
| 424 (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_
URLNotifyProcInfo, GetCurrentArchitecture()) |
| 425 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 426 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNoti
fyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
| 427 |
| 428 #else |
| 429 |
| 430 typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPRea
son reason, void* notifyData); |
| 431 #define NewNPP_URLNotifyProc(FUNC) \ |
| 432 ((NPP_URLNotifyUPP) (FUNC)) |
| 433 #define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 434 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
| 435 |
| 436 #endif |
| 437 |
| 438 |
| 439 /* NPP_GetValue */ |
| 440 |
| 441 #if _NPUPP_USE_UPP_ |
| 442 |
| 443 typedef UniversalProcPtr NPP_GetValueUPP; |
| 444 enum { |
| 445 uppNPP_GetValueProcInfo = kThinkCStackBased |
| 446 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 447 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) |
| 448 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
| 449 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 450 }; |
| 451 #define NewNPP_GetValueProc(FUNC) \ |
| 452 (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_G
etValueProcInfo, GetCurrentArchitecture()) |
| 453 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 454 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetV
alueProcInfo, (ARG1), (ARG2), (ARG3)) |
| 455 #else |
| 456 |
| 457 typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable
, void *ret_alue); |
| 458 #define NewNPP_GetValueProc(FUNC) \ |
| 459 ((NPP_GetValueUPP) (FUNC)) |
| 460 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 461 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 462 #endif |
| 463 |
| 464 |
| 465 /* NPP_SetValue */ |
| 466 |
| 467 #if _NPUPP_USE_UPP_ |
| 468 |
| 469 typedef UniversalProcPtr NPP_SetValueUPP; |
| 470 enum { |
| 471 uppNPP_SetValueProcInfo = kThinkCStackBased |
| 472 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 473 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) |
| 474 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
| 475 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 476 }; |
| 477 #define NewNPP_SetValueProc(FUNC) \ |
| 478 (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_S
etValueProcInfo, GetCurrentArchitecture()) |
| 479 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 480 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetV
alueProcInfo, (ARG1), (ARG2), (ARG3)) |
| 481 #else |
| 482 |
| 483 typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable
, void *ret_alue); |
| 484 #define NewNPP_SetValueProc(FUNC) \ |
| 485 ((NPP_SetValueUPP) (FUNC)) |
| 486 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 487 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 488 #endif |
| 489 |
| 490 |
| 491 /* |
| 492 * Netscape entry points |
| 493 */ |
| 494 |
| 495 |
| 496 /* NPN_GetValue */ |
| 497 |
| 498 #if _NPUPP_USE_UPP_ |
| 499 |
| 500 typedef UniversalProcPtr NPN_GetValueUPP; |
| 501 enum { |
| 502 uppNPN_GetValueProcInfo = kThinkCStackBased |
| 503 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 504 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) |
| 505 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
| 506 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 507 }; |
| 508 #define NewNPN_GetValueProc(FUNC) \ |
| 509 (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_G
etValueProcInfo, GetCurrentArchitecture()) |
| 510 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 511 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetV
alueProcInfo, (ARG1), (ARG2), (ARG3)) |
| 512 #else |
| 513 |
| 514 typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable
, void *ret_alue); |
| 515 #define NewNPN_GetValueProc(FUNC) \ |
| 516 ((NPN_GetValueUPP) (FUNC)) |
| 517 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 518 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 519 #endif |
| 520 |
| 521 |
| 522 /* NPN_SetValue */ |
| 523 |
| 524 #if _NPUPP_USE_UPP_ |
| 525 |
| 526 typedef UniversalProcPtr NPN_SetValueUPP; |
| 527 enum { |
| 528 uppNPN_SetValueProcInfo = kThinkCStackBased |
| 529 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 530 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) |
| 531 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) |
| 532 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 533 }; |
| 534 #define NewNPN_SetValueProc(FUNC) \ |
| 535 (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_S
etValueProcInfo, GetCurrentArchitecture()) |
| 536 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 537 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetV
alueProcInfo, (ARG1), (ARG2), (ARG3)) |
| 538 #else |
| 539 |
| 540 typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable
, void *ret_alue); |
| 541 #define NewNPN_SetValueProc(FUNC) \ |
| 542 ((NPN_SetValueUPP) (FUNC)) |
| 543 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ |
| 544 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 545 #endif |
| 546 |
| 547 |
| 548 /* NPN_GetUrlNotify */ |
| 549 |
| 550 #if _NPUPP_USE_UPP_ |
| 551 |
| 552 typedef UniversalProcPtr NPN_GetURLNotifyUPP; |
| 553 enum { |
| 554 uppNPN_GetURLNotifyProcInfo = kThinkCStackBased |
| 555 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 556 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
| 557 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
| 558 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
| 559 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 560 }; |
| 561 #define NewNPN_GetURLNotifyProc(FUNC) \ |
| 562 (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppN
PN_GetURLNotifyProcInfo, GetCurrentArchitecture()) |
| 563 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 564 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetU
RLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
| 565 #else |
| 566 |
| 567 typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url,
const char* window, void* notifyData); |
| 568 #define NewNPN_GetURLNotifyProc(FUNC) \ |
| 569 ((NPN_GetURLNotifyUPP) (FUNC)) |
| 570 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 571 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
| 572 #endif |
| 573 |
| 574 |
| 575 /* NPN_PostUrlNotify */ |
| 576 |
| 577 #if _NPUPP_USE_UPP_ |
| 578 |
| 579 typedef UniversalProcPtr NPN_PostURLNotifyUPP; |
| 580 enum { |
| 581 uppNPN_PostURLNotifyProcInfo = kThinkCStackBased |
| 582 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 583 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
| 584 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
| 585 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) |
| 586 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) |
| 587 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) |
| 588 | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) |
| 589 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 590 }; |
| 591 #define NewNPN_PostURLNotifyProc(FUNC) \ |
| 592 (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) |
| 593 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7
) \ |
| 594 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Post
URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) |
| 595 #else |
| 596 |
| 597 typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url
, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData
); |
| 598 #define NewNPN_PostURLNotifyProc(FUNC) \ |
| 599 ((NPN_PostURLNotifyUPP) (FUNC)) |
| 600 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7
) \ |
| 601 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)
) |
| 602 #endif |
| 603 |
| 604 |
| 605 /* NPN_GetUrl */ |
| 606 |
| 607 #if _NPUPP_USE_UPP_ |
| 608 |
| 609 typedef UniversalProcPtr NPN_GetURLUPP; |
| 610 enum { |
| 611 uppNPN_GetURLProcInfo = kThinkCStackBased |
| 612 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 613 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
| 614 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
| 615 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 616 }; |
| 617 #define NewNPN_GetURLProc(FUNC) \ |
| 618 (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Get
URLProcInfo, GetCurrentArchitecture()) |
| 619 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ |
| 620 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetU
RLProcInfo, (ARG1), (ARG2), (ARG3)) |
| 621 #else |
| 622 |
| 623 typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const
char* window); |
| 624 #define NewNPN_GetURLProc(FUNC) \ |
| 625 ((NPN_GetURLUPP) (FUNC)) |
| 626 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ |
| 627 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 628 #endif |
| 629 |
| 630 |
| 631 /* NPN_PostUrl */ |
| 632 |
| 633 #if _NPUPP_USE_UPP_ |
| 634 |
| 635 typedef UniversalProcPtr NPN_PostURLUPP; |
| 636 enum { |
| 637 uppNPN_PostURLProcInfo = kThinkCStackBased |
| 638 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 639 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) |
| 640 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) |
| 641 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) |
| 642 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) |
| 643 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) |
| 644 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 645 }; |
| 646 #define NewNPN_PostURLProc(FUNC) \ |
| 647 (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Po
stURLProcInfo, GetCurrentArchitecture()) |
| 648 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
| 649 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Post
URLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
| 650 #else |
| 651 |
| 652 typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, cons
t char* window, uint32 len, const char* buf, NPBool file); |
| 653 #define NewNPN_PostURLProc(FUNC) \ |
| 654 ((NPN_PostURLUPP) (FUNC)) |
| 655 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ |
| 656 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
| 657 #endif |
| 658 |
| 659 |
| 660 /* NPN_RequestRead */ |
| 661 |
| 662 #if _NPUPP_USE_UPP_ |
| 663 |
| 664 typedef UniversalProcPtr NPN_RequestReadUPP; |
| 665 enum { |
| 666 uppNPN_RequestReadProcInfo = kThinkCStackBased |
| 667 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) |
| 668 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) |
| 669 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 670 }; |
| 671 #define NewNPN_RequestReadProc(FUNC) \ |
| 672 (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_RequestReadProcInfo, GetCurrentArchitecture()) |
| 673 #define CallNPN_RequestReadProc(FUNC, stream, range) \ |
| 674 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Requ
estReadProcInfo, (stream), (range)) |
| 675 |
| 676 #else |
| 677 |
| 678 typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange*
rangeList); |
| 679 #define NewNPN_RequestReadProc(FUNC) \ |
| 680 ((NPN_RequestReadUPP) (FUNC)) |
| 681 #define CallNPN_RequestReadProc(FUNC, stream, range) \ |
| 682 (*(FUNC))((stream), (range)) |
| 683 |
| 684 #endif |
| 685 |
| 686 |
| 687 /* NPN_NewStream */ |
| 688 |
| 689 #if _NPUPP_USE_UPP_ |
| 690 |
| 691 typedef UniversalProcPtr NPN_NewStreamUPP; |
| 692 enum { |
| 693 uppNPN_NewStreamProcInfo = kThinkCStackBased |
| 694 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 695 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) |
| 696 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) |
| 697 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) |
| 698 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 699 }; |
| 700 #define NewNPN_NewStreamProc(FUNC) \ |
| 701 (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_
NewStreamProcInfo, GetCurrentArchitecture()) |
| 702 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ |
| 703 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewS
treamProcInfo, (npp), (type), (window), (stream)) |
| 704 |
| 705 #else |
| 706 |
| 707 typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, co
nst char* window, NPStream** stream); |
| 708 #define NewNPN_NewStreamProc(FUNC) \ |
| 709 ((NPN_NewStreamUPP) (FUNC)) |
| 710 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ |
| 711 (*(FUNC))((npp), (type), (window), (stream)) |
| 712 |
| 713 #endif |
| 714 |
| 715 |
| 716 /* NPN_Write */ |
| 717 |
| 718 #if _NPUPP_USE_UPP_ |
| 719 |
| 720 typedef UniversalProcPtr NPN_WriteUPP; |
| 721 enum { |
| 722 uppNPN_WriteProcInfo = kThinkCStackBased |
| 723 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 724 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 725 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) |
| 726 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) |
| 727 | RESULT_SIZE(SIZE_CODE(sizeof(int32))) |
| 728 }; |
| 729 #define NewNPN_WriteProc(FUNC) \ |
| 730 (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Writ
eProcInfo, GetCurrentArchitecture()) |
| 731 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ |
| 732 (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteP
rocInfo, (npp), (stream), (len), (buffer)) |
| 733 |
| 734 #else |
| 735 |
| 736 typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 l
en, void* buffer); |
| 737 #define NewNPN_WriteProc(FUNC) \ |
| 738 ((NPN_WriteUPP) (FUNC)) |
| 739 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ |
| 740 (*(FUNC))((npp), (stream), (len), (buffer)) |
| 741 |
| 742 #endif |
| 743 |
| 744 |
| 745 /* NPN_DestroyStream */ |
| 746 |
| 747 #if _NPUPP_USE_UPP_ |
| 748 |
| 749 typedef UniversalProcPtr NPN_DestroyStreamUPP; |
| 750 enum { |
| 751 uppNPN_DestroyStreamProcInfo = kThinkCStackBased |
| 752 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) |
| 753 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) |
| 754 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) |
| 755 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 756 }; |
| 757 #define NewNPN_DestroyStreamProc(FUNC) \ |
| 758 (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPN_DestroyStreamProcInfo, GetCurrentArchitecture()) |
| 759 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ |
| 760 (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Dest
royStreamProcInfo, (npp), (stream), (reason)) |
| 761 |
| 762 #else |
| 763 |
| 764 typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* strea
m, NPReason reason); |
| 765 #define NewNPN_DestroyStreamProc(FUNC) \ |
| 766 ((NPN_DestroyStreamUPP) (FUNC)) |
| 767 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ |
| 768 (*(FUNC))((npp), (stream), (reason)) |
| 769 |
| 770 #endif |
| 771 |
| 772 |
| 773 /* NPN_Status */ |
| 774 |
| 775 #if _NPUPP_USE_UPP_ |
| 776 |
| 777 typedef UniversalProcPtr NPN_StatusUPP; |
| 778 enum { |
| 779 uppNPN_StatusProcInfo = kThinkCStackBased |
| 780 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 781 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) |
| 782 }; |
| 783 |
| 784 #define NewNPN_StatusProc(FUNC) \ |
| 785 (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Sta
tusProcInfo, GetCurrentArchitecture()) |
| 786 #define CallNPN_StatusProc(FUNC, npp, msg) \ |
| 787 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusP
rocInfo, (npp), (msg)) |
| 788 |
| 789 #else |
| 790 |
| 791 typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message); |
| 792 #define NewNPN_StatusProc(FUNC) \ |
| 793 ((NPN_StatusUPP) (FUNC)) |
| 794 #define CallNPN_StatusProc(FUNC, npp, msg) \ |
| 795 (*(FUNC))((npp), (msg)) |
| 796 |
| 797 #endif |
| 798 |
| 799 |
| 800 /* NPN_UserAgent */ |
| 801 #if _NPUPP_USE_UPP_ |
| 802 |
| 803 typedef UniversalProcPtr NPN_UserAgentUPP; |
| 804 enum { |
| 805 uppNPN_UserAgentProcInfo = kThinkCStackBased |
| 806 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 807 | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) |
| 808 }; |
| 809 |
| 810 #define NewNPN_UserAgentProc(FUNC) \ |
| 811 (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_
UserAgentProcInfo, GetCurrentArchitecture()) |
| 812 #define CallNPN_UserAgentProc(FUNC, ARG1) \ |
| 813 (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_
UserAgentProcInfo, (ARG1)) |
| 814 |
| 815 #else |
| 816 |
| 817 typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance); |
| 818 #define NewNPN_UserAgentProc(FUNC) \ |
| 819 ((NPN_UserAgentUPP) (FUNC)) |
| 820 #define CallNPN_UserAgentProc(FUNC, ARG1) \ |
| 821 (*(FUNC))((ARG1)) |
| 822 |
| 823 #endif |
| 824 |
| 825 |
| 826 /* NPN_MemAlloc */ |
| 827 #if _NPUPP_USE_UPP_ |
| 828 |
| 829 typedef UniversalProcPtr NPN_MemAllocUPP; |
| 830 enum { |
| 831 uppNPN_MemAllocProcInfo = kThinkCStackBased |
| 832 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) |
| 833 | RESULT_SIZE(SIZE_CODE(sizeof(void *))) |
| 834 }; |
| 835 |
| 836 #define NewNPN_MemAllocProc(FUNC) \ |
| 837 (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_M
emAllocProcInfo, GetCurrentArchitecture()) |
| 838 #define CallNPN_MemAllocProc(FUNC, ARG1) \ |
| 839 (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAll
ocProcInfo, (ARG1)) |
| 840 |
| 841 #else |
| 842 |
| 843 typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size); |
| 844 #define NewNPN_MemAllocProc(FUNC) \ |
| 845 ((NPN_MemAllocUPP) (FUNC)) |
| 846 #define CallNPN_MemAllocProc(FUNC, ARG1) \ |
| 847 (*(FUNC))((ARG1)) |
| 848 |
| 849 #endif |
| 850 |
| 851 |
| 852 /* NPN__MemFree */ |
| 853 |
| 854 #if _NPUPP_USE_UPP_ |
| 855 |
| 856 typedef UniversalProcPtr NPN_MemFreeUPP; |
| 857 enum { |
| 858 uppNPN_MemFreeProcInfo = kThinkCStackBased |
| 859 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) |
| 860 }; |
| 861 |
| 862 #define NewNPN_MemFreeProc(FUNC) \ |
| 863 (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Me
mFreeProcInfo, GetCurrentArchitecture()) |
| 864 #define CallNPN_MemFreeProc(FUNC, ARG1) \ |
| 865 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFree
ProcInfo, (ARG1)) |
| 866 |
| 867 #else |
| 868 |
| 869 typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr); |
| 870 #define NewNPN_MemFreeProc(FUNC) \ |
| 871 ((NPN_MemFreeUPP) (FUNC)) |
| 872 #define CallNPN_MemFreeProc(FUNC, ARG1) \ |
| 873 (*(FUNC))((ARG1)) |
| 874 |
| 875 #endif |
| 876 |
| 877 |
| 878 /* NPN_MemFlush */ |
| 879 |
| 880 #if _NPUPP_USE_UPP_ |
| 881 |
| 882 typedef UniversalProcPtr NPN_MemFlushUPP; |
| 883 enum { |
| 884 uppNPN_MemFlushProcInfo = kThinkCStackBased |
| 885 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) |
| 886 | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) |
| 887 }; |
| 888 |
| 889 #define NewNPN_MemFlushProc(FUNC) \ |
| 890 (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_M
emFlushProcInfo, GetCurrentArchitecture()) |
| 891 #define CallNPN_MemFlushProc(FUNC, ARG1) \ |
| 892 (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFl
ushProcInfo, (ARG1)) |
| 893 |
| 894 #else |
| 895 |
| 896 typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size); |
| 897 #define NewNPN_MemFlushProc(FUNC) \ |
| 898 ((NPN_MemFlushUPP) (FUNC)) |
| 899 #define CallNPN_MemFlushProc(FUNC, ARG1) \ |
| 900 (*(FUNC))((ARG1)) |
| 901 |
| 902 #endif |
| 903 |
| 904 |
| 905 |
| 906 /* NPN_ReloadPlugins */ |
| 907 |
| 908 #if _NPUPP_USE_UPP_ |
| 909 |
| 910 typedef UniversalProcPtr NPN_ReloadPluginsUPP; |
| 911 enum { |
| 912 uppNPN_ReloadPluginsProcInfo = kThinkCStackBased |
| 913 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) |
| 914 | RESULT_SIZE(SIZE_CODE(0)) |
| 915 }; |
| 916 |
| 917 #define NewNPN_ReloadPluginsProc(FUNC) \ |
| 918 (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) |
| 919 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ |
| 920 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadP
luginsProcInfo, (ARG1)) |
| 921 |
| 922 #else |
| 923 |
| 924 typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages); |
| 925 #define NewNPN_ReloadPluginsProc(FUNC) \ |
| 926 ((NPN_ReloadPluginsUPP) (FUNC)) |
| 927 #define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ |
| 928 (*(FUNC))((ARG1)) |
| 929 |
| 930 #endif |
| 931 |
| 932 /* NPN_GetJavaEnv */ |
| 933 |
| 934 #if _NPUPP_USE_UPP_ |
| 935 |
| 936 typedef UniversalProcPtr NPN_GetJavaEnvUPP; |
| 937 enum { |
| 938 uppNPN_GetJavaEnvProcInfo = kThinkCStackBased |
| 939 | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*))) |
| 940 }; |
| 941 |
| 942 #define NewNPN_GetJavaEnvProc(FUNC) \ |
| 943 (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN
_GetJavaEnvProcInfo, GetCurrentArchitecture()) |
| 944 #define CallNPN_GetJavaEnvProc(FUNC) \ |
| 945 (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJ
avaEnvProcInfo) |
| 946 |
| 947 #else |
| 948 typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void); |
| 949 #define NewNPN_GetJavaEnvProc(FUNC) \ |
| 950 ((NPN_GetJavaEnvUPP) (FUNC)) |
| 951 #define CallNPN_GetJavaEnvProc(FUNC) \ |
| 952 (*(FUNC))() |
| 953 |
| 954 #endif |
| 955 |
| 956 |
| 957 /* NPN_GetJavaPeer */ |
| 958 |
| 959 #if _NPUPP_USE_UPP_ |
| 960 |
| 961 typedef UniversalProcPtr NPN_GetJavaPeerUPP; |
| 962 enum { |
| 963 uppNPN_GetJavaPeerProcInfo = kThinkCStackBased |
| 964 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 965 | RESULT_SIZE(SIZE_CODE(sizeof(jref))) |
| 966 }; |
| 967 |
| 968 #define NewNPN_GetJavaPeerProc(FUNC) \ |
| 969 (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_GetJavaPeerProcInfo, GetCurrentArchitecture()) |
| 970 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ |
| 971 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJava
PeerProcInfo, (ARG1)) |
| 972 |
| 973 #else |
| 974 |
| 975 typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance); |
| 976 #define NewNPN_GetJavaPeerProc(FUNC) \ |
| 977 ((NPN_GetJavaPeerUPP) (FUNC)) |
| 978 #define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ |
| 979 (*(FUNC))((ARG1)) |
| 980 |
| 981 #endif |
| 982 |
| 983 /* NPN_InvalidateRect */ |
| 984 |
| 985 #if _NPUPP_USE_UPP_ |
| 986 |
| 987 typedef UniversalProcPtr NPN_InvalidateRectUPP; |
| 988 enum { |
| 989 uppNPN_InvalidateRectProcInfo = kThinkCStackBased |
| 990 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 991 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *))) |
| 992 | RESULT_SIZE(SIZE_CODE(0)) |
| 993 }; |
| 994 |
| 995 #define NewNPN_InvalidateRectProc(FUNC) \ |
| 996 (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), up
pNPN_InvalidateRectProcInfo, GetCurrentArchitecture()) |
| 997 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ |
| 998 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Invalid
ateRectProcInfo, (ARG1), (ARG2)) |
| 999 |
| 1000 #else |
| 1001 |
| 1002 typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect); |
| 1003 #define NewNPN_InvalidateRectProc(FUNC) \ |
| 1004 ((NPN_InvalidateRectUPP) (FUNC)) |
| 1005 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ |
| 1006 (*(FUNC))((ARG1), (ARG2)) |
| 1007 |
| 1008 #endif |
| 1009 |
| 1010 |
| 1011 /* NPN_InvalidateRegion */ |
| 1012 |
| 1013 #if _NPUPP_USE_UPP_ |
| 1014 |
| 1015 typedef UniversalProcPtr NPN_InvalidateRegionUPP; |
| 1016 enum { |
| 1017 uppNPN_InvalidateRegionProcInfo = kThinkCStackBased |
| 1018 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1019 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion))) |
| 1020 | RESULT_SIZE(SIZE_CODE(0)) |
| 1021 }; |
| 1022 |
| 1023 #define NewNPN_InvalidateRegionProc(FUNC) \ |
| 1024 (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC),
uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture()) |
| 1025 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ |
| 1026 (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Invalid
ateRegionProcInfo, (ARG1), (ARG2)) |
| 1027 |
| 1028 #else |
| 1029 |
| 1030 typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region
); |
| 1031 #define NewNPN_InvalidateRegionProc(FUNC) \ |
| 1032 ((NPN_InvalidateRegionUPP) (FUNC)) |
| 1033 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ |
| 1034 (*(FUNC))((ARG1), (ARG2)) |
| 1035 |
| 1036 #endif |
| 1037 |
| 1038 /* NPN_ForceRedraw */ |
| 1039 |
| 1040 #if _NPUPP_USE_UPP_ |
| 1041 |
| 1042 typedef UniversalProcPtr NPN_ForceRedrawUPP; |
| 1043 enum { |
| 1044 uppNPN_ForceRedrawProcInfo = kThinkCStackBased |
| 1045 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1046 | RESULT_SIZE(SIZE_CODE(sizeof(0))) |
| 1047 }; |
| 1048 |
| 1049 #define NewNPN_ForceRedrawProc(FUNC) \ |
| 1050 (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_ForceRedrawProcInfo, GetCurrentArchitecture()) |
| 1051 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \ |
| 1052 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRe
drawProcInfo, (ARG1)) |
| 1053 |
| 1054 #else |
| 1055 |
| 1056 typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance); |
| 1057 #define NewNPN_ForceRedrawProc(FUNC) \ |
| 1058 ((NPN_ForceRedrawUPP) (FUNC)) |
| 1059 #define CallNPN_ForceRedrawProc(FUNC, ARG1) \ |
| 1060 (*(FUNC))((ARG1)) |
| 1061 |
| 1062 #endif |
| 1063 |
| 1064 /* NPN_GetStringIdentifier */ |
| 1065 |
| 1066 #if _NPUPP_USE_UPP_ |
| 1067 |
| 1068 typedef UniversalProcPtr NPN_GetStringIdentifierUPP; |
| 1069 enum { |
| 1070 uppNPN_GetStringIdentifierProcInfo = kThinkCStackBased |
| 1071 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8*))) |
| 1072 | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier))) |
| 1073 }; |
| 1074 |
| 1075 #define NewNPN_GetStringIdentifierProc(FUNC) \ |
| 1076 (NPN_GetStringIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC
), uppNPN_GetStringIdentifierProcInfo, GetCurrentArchitecture()) |
| 1077 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \ |
| 1078 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStri
ngIdentifierProcInfo, (ARG1)) |
| 1079 |
| 1080 #else |
| 1081 |
| 1082 typedef NPIdentifier (* NP_LOADDS NPN_GetStringIdentifierUPP)(const NPUTF8* name
); |
| 1083 #define NewNPN_GetStringIdentifierProc(FUNC) \ |
| 1084 ((NPN_GetStringIdentifierUPP) (FUNC)) |
| 1085 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \ |
| 1086 (*(FUNC))((ARG1)) |
| 1087 |
| 1088 #endif |
| 1089 |
| 1090 /* NPN_GetStringIdentifiers */ |
| 1091 |
| 1092 #if _NPUPP_USE_UPP_ |
| 1093 |
| 1094 typedef UniversalProcPtr NPN_GetStringIdentifiersUPP; |
| 1095 enum { |
| 1096 uppNPN_GetStringIdentifiersProcInfo = kThinkCStackBased |
| 1097 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8**))) |
| 1098 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32_t))) |
| 1099 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier*))) |
| 1100 | RESULT_SIZE(SIZE_CODE(0)) |
| 1101 }; |
| 1102 |
| 1103 #define NewNPN_GetStringIdentifiersProc(FUNC) \ |
| 1104 (NPN_GetStringIdentifiersUPP) NewRoutineDescriptor((ProcPtr)(FUN
C), uppNPN_GetStringIdentifiersProcInfo, GetCurrentArchitecture()) |
| 1105 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3)
\ |
| 1106 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStri
ngIdentifiersProcInfo, (ARG1), (ARG2), (ARG3)) |
| 1107 |
| 1108 #else |
| 1109 |
| 1110 typedef void (* NP_LOADDS NPN_GetStringIdentifiersUPP)(const NPUTF8** names, |
| 1111 int32_t nameCount, |
| 1112 NPIdentifier* identifiers); |
| 1113 #define NewNPN_GetStringIdentifiersProc(FUNC) \ |
| 1114 ((NPN_GetStringIdentifiersUPP) (FUNC)) |
| 1115 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3)
\ |
| 1116 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 1117 |
| 1118 #endif |
| 1119 |
| 1120 /* NPN_GetIntIdentifier */ |
| 1121 |
| 1122 #if _NPUPP_USE_UPP_ |
| 1123 |
| 1124 typedef UniversalProcPtr NPN_GetIntIdentifierUPP; |
| 1125 enum { |
| 1126 uppNPN_GetIntIdentifierProcInfo = kThinkCStackBased |
| 1127 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32_t))) |
| 1128 | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier))) |
| 1129 }; |
| 1130 |
| 1131 #define NewNPN_GetIntIdentifierProc(FUNC) \ |
| 1132 (NPN_GetIntIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC),
uppNPN_GetIntIdentifierProcInfo, GetCurrentArchitecture()) |
| 1133 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \ |
| 1134 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetIntI
dentifierProcInfo, (ARG1)) |
| 1135 |
| 1136 #else |
| 1137 |
| 1138 typedef NPIdentifier (* NP_LOADDS NPN_GetIntIdentifierUPP)(int32_t intid); |
| 1139 #define NewNPN_GetIntIdentifierProc(FUNC) \ |
| 1140 ((NPN_GetIntIdentifierUPP) (FUNC)) |
| 1141 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \ |
| 1142 (*(FUNC))((ARG1)) |
| 1143 |
| 1144 #endif |
| 1145 |
| 1146 /* NPN_IdentifierIsString */ |
| 1147 |
| 1148 #if _NPUPP_USE_UPP_ |
| 1149 |
| 1150 typedef UniversalProcPtr NPN_IdentifierIsStringUPP; |
| 1151 enum { |
| 1152 uppNPN_IdentifierIsStringProcInfo = kThinkCStackBased |
| 1153 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier ident
ifier))) |
| 1154 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1155 }; |
| 1156 |
| 1157 #define NewNPN_IdentifierIsStringProc(FUNC) \ |
| 1158 (NPN_IdentifierIsStringUPP) NewRoutineDescriptor((ProcPtr)(FUNC)
, uppNPN_IdentifierIsStringProcInfo, GetCurrentArchitecture()) |
| 1159 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \ |
| 1160 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Identif
ierIsStringProcInfo, (ARG1)) |
| 1161 |
| 1162 #else |
| 1163 |
| 1164 typedef bool (* NP_LOADDS NPN_IdentifierIsStringUPP)(NPIdentifier identifier); |
| 1165 #define NewNPN_IdentifierIsStringProc(FUNC) \ |
| 1166 ((NPN_IdentifierIsStringUPP) (FUNC)) |
| 1167 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \ |
| 1168 (*(FUNC))((ARG1)) |
| 1169 |
| 1170 #endif |
| 1171 |
| 1172 /* NPN_UTF8FromIdentifier */ |
| 1173 |
| 1174 #if _NPUPP_USE_UPP_ |
| 1175 |
| 1176 typedef UniversalProcPtr NPN_UTF8FromIdentifierUPP; |
| 1177 enum { |
| 1178 uppNPN_UTF8FromIdentifierProcInfo = kThinkCStackBased |
| 1179 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier))) |
| 1180 | RESULT_SIZE(SIZE_CODE(sizeof(NPUTF8*))) |
| 1181 }; |
| 1182 |
| 1183 #define NewNPN_UTF8FromIdentifierProc(FUNC) \ |
| 1184 (NPN_UTF8FromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC)
, uppNPN_UTF8FromIdentifierProcInfo, GetCurrentArchitecture()) |
| 1185 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \ |
| 1186 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UTF8Fro
mIdentifierProcInfo, (ARG1)) |
| 1187 |
| 1188 #else |
| 1189 |
| 1190 typedef NPUTF8* (* NP_LOADDS NPN_UTF8FromIdentifierUPP)(NPIdentifier identifier)
; |
| 1191 #define NewNPN_UTF8FromIdentifierProc(FUNC) \ |
| 1192 ((NPN_UTF8FromIdentifierUPP) (FUNC)) |
| 1193 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \ |
| 1194 (*(FUNC))((ARG1)) |
| 1195 |
| 1196 #endif |
| 1197 |
| 1198 /* NPN_IntFromIdentifier */ |
| 1199 |
| 1200 #if _NPUPP_USE_UPP_ |
| 1201 |
| 1202 typedef UniversalProcPtr NPN_IntFromIdentifierUPP; |
| 1203 enum { |
| 1204 uppNPN_IntFromIdentifierProcInfo = kThinkCStackBased |
| 1205 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier))) |
| 1206 | RESULT_SIZE(SIZE_CODE(sizeof(int32_t))) |
| 1207 }; |
| 1208 |
| 1209 #define NewNPN_IntFromIdentifierProc(FUNC) \ |
| 1210 (NPN_IntFromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC),
uppNPN_IntFromIdentifierProcInfo, GetCurrentArchitecture()) |
| 1211 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \ |
| 1212 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IntFrom
IdentifierProcInfo, (ARG1)) |
| 1213 |
| 1214 #else |
| 1215 |
| 1216 typedef int32_t (* NP_LOADDS NPN_IntFromIdentifierUPP)(NPIdentifier identifier); |
| 1217 #define NewNPN_IntFromIdentifierProc(FUNC) \ |
| 1218 ((NPN_IntFromIdentifierUPP) (FUNC)) |
| 1219 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \ |
| 1220 (*(FUNC))((ARG1)) |
| 1221 |
| 1222 #endif |
| 1223 |
| 1224 /* NPN_CreateObject */ |
| 1225 |
| 1226 #if _NPUPP_USE_UPP_ |
| 1227 |
| 1228 typedef UniversalProcPtr NPN_CreateObjectUPP; |
| 1229 enum { |
| 1230 uppNPN_CreateObjectProcInfo = kThinkCStackBased |
| 1231 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1232 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPClass*))) |
| 1233 | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*))) |
| 1234 }; |
| 1235 |
| 1236 #define NewNPN_CreateObjectProc(FUNC) \ |
| 1237 (NPN_CreateObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppN
PN_CreateObjectProcInfo, GetCurrentArchitecture()) |
| 1238 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \ |
| 1239 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_CreateO
bjectProcInfo, (ARG1), (ARG2)) |
| 1240 |
| 1241 #else |
| 1242 |
| 1243 typedef NPObject* (* NP_LOADDS NPN_CreateObjectUPP)(NPP npp, NPClass *aClass); |
| 1244 #define NewNPN_CreateObjectProc(FUNC) \ |
| 1245 ((NPN_CreateObjectUPP) (FUNC)) |
| 1246 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \ |
| 1247 (*(FUNC))((ARG1), (ARG2)) |
| 1248 |
| 1249 #endif |
| 1250 |
| 1251 /* NPN_RetainObject */ |
| 1252 |
| 1253 #if _NPUPP_USE_UPP_ |
| 1254 |
| 1255 typedef UniversalProcPtr NPN_RetainObjectUPP; |
| 1256 enum { |
| 1257 uppNPN_RetainObjectProcInfo = kThinkCStackBased |
| 1258 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*))) |
| 1259 | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*))) |
| 1260 }; |
| 1261 |
| 1262 #define NewNPN_RetainObjectProc(FUNC) \ |
| 1263 (NPN_RetainObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppN
PN_RetainObjectProcInfo, GetCurrentArchitecture()) |
| 1264 #define CallNPN_RetainObjectProc(FUNC, ARG1) \ |
| 1265 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RetainO
bjectProcInfo, (ARG1)) |
| 1266 |
| 1267 #else |
| 1268 |
| 1269 typedef NPObject* (* NP_LOADDS NPN_RetainObjectUPP)(NPObject *obj); |
| 1270 #define NewNPN_RetainObjectProc(FUNC) \ |
| 1271 ((NPN_RetainObjectUPP) (FUNC)) |
| 1272 #define CallNPN_RetainObjectProc(FUNC, ARG1) \ |
| 1273 (*(FUNC))((ARG1)) |
| 1274 |
| 1275 #endif |
| 1276 |
| 1277 /* NPN_ReleaseObject */ |
| 1278 |
| 1279 #if _NPUPP_USE_UPP_ |
| 1280 |
| 1281 typedef UniversalProcPtr NPN_ReleaseObjectUPP; |
| 1282 enum { |
| 1283 uppNPN_ReleaseObjectProcInfo = kThinkCStackBased |
| 1284 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*))) |
| 1285 | RESULT_SIZE(SIZE_CODE(0)) |
| 1286 }; |
| 1287 |
| 1288 #define NewNPN_ReleaseObjectProc(FUNC) \ |
| 1289 (NPN_ReleaseObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPN_ReleaseObjectProcInfo, GetCurrentArchitecture()) |
| 1290 #define CallNPN_ReleaseObjectProc(FUNC, ARG1) \ |
| 1291 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Release
ObjectProcInfo, (ARG1)) |
| 1292 |
| 1293 #else |
| 1294 |
| 1295 typedef void (* NP_LOADDS NPN_ReleaseObjectUPP)(NPObject *obj); |
| 1296 #define NewNPN_ReleaseObjectProc(FUNC) \ |
| 1297 ((NPN_ReleaseObjectUPP) (FUNC)) |
| 1298 #define CallNPN_ReleaseObjectProc(FUNC, ARG1) \ |
| 1299 (*(FUNC))((ARG1)) |
| 1300 |
| 1301 #endif |
| 1302 |
| 1303 /* NPN_Invoke */ |
| 1304 |
| 1305 #if _NPUPP_USE_UPP_ |
| 1306 |
| 1307 typedef UniversalProcPtr NPN_InvokeUPP; |
| 1308 enum { |
| 1309 uppNPN_InvokeProcInfo = kThinkCStackBased |
| 1310 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1311 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1312 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1313 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*))
) |
| 1314 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t))) |
| 1315 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*))) |
| 1316 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1317 }; |
| 1318 |
| 1319 #define NewNPN_InvokeProc(FUNC) \ |
| 1320 (NPN_InvokeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_Inv
okeProcInfo, GetCurrentArchitecture()) |
| 1321 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)
\ |
| 1322 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeP
rocInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
| 1323 |
| 1324 #else |
| 1325 |
| 1326 typedef bool (* NP_LOADDS NPN_InvokeUPP)(NPP npp, NPObject* obj, NPIdentifier me
thodName, const NPVariant *args, uint32_t argCount, NPVariant *result); |
| 1327 #define NewNPN_InvokeProc(FUNC) \ |
| 1328 ((NPN_InvokeUPP) (FUNC)) |
| 1329 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)
\ |
| 1330 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) |
| 1331 |
| 1332 #endif |
| 1333 |
| 1334 /* NPN_InvokeDefault */ |
| 1335 |
| 1336 #if _NPUPP_USE_UPP_ |
| 1337 |
| 1338 typedef UniversalProcPtr NPN_InvokeDefaultUPP; |
| 1339 enum { |
| 1340 uppNPN_InvokeDefaultProcInfo = kThinkCStackBased |
| 1341 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1342 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1343 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*))
) |
| 1344 | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t))) |
| 1345 | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*))) |
| 1346 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1347 }; |
| 1348 |
| 1349 #define NewNPN_InvokeDefaultProc(FUNC) \ |
| 1350 (NPN_InvokeDefaultUPP) NewRoutineDescriptor((ProcPtr)(FUNC), upp
NPN_InvokeDefaultProcInfo, GetCurrentArchitecture()) |
| 1351 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)
\ |
| 1352 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeD
efaultProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
| 1353 |
| 1354 #else |
| 1355 |
| 1356 typedef bool (* NP_LOADDS NPN_InvokeDefaultUPP)(NPP npp, NPObject* obj, const NP
Variant *args, uint32_t argCount, NPVariant *result); |
| 1357 #define NewNPN_InvokeDefaultProc(FUNC) \ |
| 1358 ((NPN_InvokeDefaultUPP) (FUNC)) |
| 1359 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)
\ |
| 1360 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) |
| 1361 |
| 1362 #endif |
| 1363 |
| 1364 /* NPN_Evaluate */ |
| 1365 |
| 1366 #if _NPUPP_USE_UPP_ |
| 1367 |
| 1368 typedef UniversalProcPtr NPN_EvaluateUPP; |
| 1369 enum { |
| 1370 uppNPN_EvaluateProcInfo = kThinkCStackBased |
| 1371 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1372 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1373 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPString*))) |
| 1374 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*))) |
| 1375 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1376 }; |
| 1377 |
| 1378 #define NewNPN_EvaluateProc(FUNC) \ |
| 1379 (NPN_EvaluateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_E
valuateProcInfo, GetCurrentArchitecture()) |
| 1380 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1381 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Evaluat
eProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
| 1382 |
| 1383 #else |
| 1384 |
| 1385 typedef bool (* NP_LOADDS NPN_EvaluateUPP)(NPP npp, NPObject *obj, NPString *scr
ipt, NPVariant *result); |
| 1386 #define NewNPN_EvaluateProc(FUNC) \ |
| 1387 ((NPN_EvaluateUPP) (FUNC)) |
| 1388 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1389 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
| 1390 |
| 1391 #endif |
| 1392 |
| 1393 /* NPN_GetProperty */ |
| 1394 |
| 1395 #if _NPUPP_USE_UPP_ |
| 1396 |
| 1397 typedef UniversalProcPtr NPN_GetPropertyUPP; |
| 1398 enum { |
| 1399 uppNPN_GetPropertyProcInfo = kThinkCStackBased |
| 1400 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1401 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1402 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1403 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*))) |
| 1404 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1405 }; |
| 1406 |
| 1407 #define NewNPN_GetPropertyProc(FUNC) \ |
| 1408 (NPN_GetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_GetPropertyProcInfo, GetCurrentArchitecture()) |
| 1409 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1410 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetProp
ertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
| 1411 |
| 1412 #else |
| 1413 |
| 1414 typedef bool (* NP_LOADDS NPN_GetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifi
er propertyName, NPVariant *result); |
| 1415 #define NewNPN_GetPropertyProc(FUNC) \ |
| 1416 ((NPN_GetPropertyUPP) (FUNC)) |
| 1417 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1418 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
| 1419 |
| 1420 #endif |
| 1421 |
| 1422 /* NPN_SetProperty */ |
| 1423 |
| 1424 #if _NPUPP_USE_UPP_ |
| 1425 |
| 1426 typedef UniversalProcPtr NPN_SetPropertyUPP; |
| 1427 enum { |
| 1428 uppNPN_SetPropertyProcInfo = kThinkCStackBased |
| 1429 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1430 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1431 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1432 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*))
) |
| 1433 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1434 }; |
| 1435 |
| 1436 #define NewNPN_SetPropertyProc(FUNC) \ |
| 1437 (NPN_SetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_SetPropertyProcInfo, GetCurrentArchitecture()) |
| 1438 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1439 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetProp
ertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) |
| 1440 |
| 1441 #else |
| 1442 |
| 1443 typedef bool (* NP_LOADDS NPN_SetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifi
er propertyName, const NPVariant *value); |
| 1444 #define NewNPN_SetPropertyProc(FUNC) \ |
| 1445 ((NPN_SetPropertyUPP) (FUNC)) |
| 1446 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ |
| 1447 (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) |
| 1448 |
| 1449 #endif |
| 1450 |
| 1451 /* NPN_RemoveProperty */ |
| 1452 |
| 1453 #if _NPUPP_USE_UPP_ |
| 1454 |
| 1455 typedef UniversalProcPtr NPN_RemovePropertyUPP; |
| 1456 enum { |
| 1457 uppNPN_RemovePropertyProcInfo = kThinkCStackBased |
| 1458 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1459 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1460 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1461 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1462 }; |
| 1463 |
| 1464 #define NewNPN_RemovePropertyProc(FUNC) \ |
| 1465 (NPN_RemovePropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), up
pNPN_RemovePropertyProcInfo, GetCurrentArchitecture()) |
| 1466 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1467 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RemoveP
ropertyProcInfo, (ARG1), (ARG2), (ARG3)) |
| 1468 |
| 1469 #else |
| 1470 |
| 1471 typedef bool (* NP_LOADDS NPN_RemovePropertyUPP)(NPP npp, NPObject *obj, NPIdent
ifier propertyName); |
| 1472 #define NewNPN_RemovePropertyProc(FUNC) \ |
| 1473 ((NPN_RemovePropertyUPP) (FUNC)) |
| 1474 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1475 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 1476 |
| 1477 #endif |
| 1478 |
| 1479 /* NPN_HasProperty */ |
| 1480 |
| 1481 #if _NPUPP_USE_UPP_ |
| 1482 |
| 1483 typedef UniversalProcPtr NPN_HasPropertyUPP; |
| 1484 enum { |
| 1485 uppNPN_HasPropertyProcInfo = kThinkCStackBased |
| 1486 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1487 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1488 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1489 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1490 }; |
| 1491 |
| 1492 #define NewNPN_HasPropertyProc(FUNC) \ |
| 1493 (NPN_HasPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP
N_HasPropertyProcInfo, GetCurrentArchitecture()) |
| 1494 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1495 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasProp
ertyProcInfo, (ARG1), (ARG2), (ARG3)) |
| 1496 |
| 1497 #else |
| 1498 |
| 1499 typedef bool (* NP_LOADDS NPN_HasPropertyUPP)(NPP npp, NPObject *obj, NPIdentifi
er propertyName); |
| 1500 #define NewNPN_HasPropertyProc(FUNC) \ |
| 1501 ((NPN_HasPropertyUPP) (FUNC)) |
| 1502 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1503 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 1504 |
| 1505 #endif |
| 1506 |
| 1507 /* NPN_HasMethod */ |
| 1508 |
| 1509 #if _NPUPP_USE_UPP_ |
| 1510 |
| 1511 typedef UniversalProcPtr NPN_HasMethodUPP; |
| 1512 enum { |
| 1513 uppNPN_HasMethodProcInfo = kThinkCStackBased |
| 1514 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1515 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*))) |
| 1516 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier))) |
| 1517 | RESULT_SIZE(SIZE_CODE(sizeof(bool))) |
| 1518 }; |
| 1519 |
| 1520 #define NewNPN_HasMethodProc(FUNC) \ |
| 1521 (NPN_HasMethodUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_
HasMethodProcInfo, GetCurrentArchitecture()) |
| 1522 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1523 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasMeth
odProcInfo, (ARG1), (ARG2), (ARG3)) |
| 1524 |
| 1525 #else |
| 1526 |
| 1527 typedef bool (* NP_LOADDS NPN_HasMethodUPP)(NPP npp, NPObject *obj, NPIdentifier
propertyName); |
| 1528 #define NewNPN_HasMethodProc(FUNC) \ |
| 1529 ((NPN_HasMethodUPP) (FUNC)) |
| 1530 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \ |
| 1531 (*(FUNC))((ARG1), (ARG2), (ARG3)) |
| 1532 |
| 1533 #endif |
| 1534 |
| 1535 /* NPN_ReleaseVariantValue */ |
| 1536 |
| 1537 #if _NPUPP_USE_UPP_ |
| 1538 |
| 1539 typedef UniversalProcPtr NPN_ReleaseVariantValue; |
| 1540 enum { |
| 1541 uppNPN_ReleaseVariantValueProcInfo = kThinkCStackBased |
| 1542 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPVariant*))) |
| 1543 | RESULT_SIZE(SIZE_CODE(0)) |
| 1544 }; |
| 1545 |
| 1546 #define NewNPN_ReleaseVariantValueProc(FUNC) \ |
| 1547 (NPN_ReleaseVariantValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC
), uppNPN_ReleaseVariantValueProcInfo, GetCurrentArchitecture()) |
| 1548 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \ |
| 1549 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_Release
VariantValueProcInfo, (ARG1)) |
| 1550 |
| 1551 #else |
| 1552 |
| 1553 typedef void (* NP_LOADDS NPN_ReleaseVariantValueUPP)(NPVariant *variant); |
| 1554 #define NewNPN_ReleaseVariantValueProc(FUNC) \ |
| 1555 ((NPN_ReleaseVariantValueUPP) (FUNC)) |
| 1556 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \ |
| 1557 (*(FUNC))((ARG1)) |
| 1558 |
| 1559 #endif |
| 1560 |
| 1561 /* NPN_SetException */ |
| 1562 |
| 1563 #if _NPUPP_USE_UPP_ |
| 1564 |
| 1565 typedef UniversalProcPtr NPN_SetExceptionUPP; |
| 1566 enum { |
| 1567 uppNPN_SetExceptionProcInfo = kThinkCStackBased |
| 1568 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*))) |
| 1569 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const NPUTF8*))) |
| 1570 | RESULT_SIZE(SIZE_CODE(0)) |
| 1571 }; |
| 1572 |
| 1573 #define NewNPN_SetExceptionProc(FUNC) \ |
| 1574 (NPN_SetExceptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppN
PN_SetExceptionProcInfo, GetCurrentArchitecture()) |
| 1575 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \ |
| 1576 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetExce
ptionProcInfo, (ARG1), (ARG2)) |
| 1577 |
| 1578 #else |
| 1579 |
| 1580 typedef void (* NP_LOADDS NPN_SetExceptionUPP)(NPObject *obj, const NPUTF8 *mess
age); |
| 1581 #define NewNPN_SetExceptionProc(FUNC) \ |
| 1582 ((NPN_SetExceptionUPP) (FUNC)) |
| 1583 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \ |
| 1584 (*(FUNC))((ARG1), (ARG2)) |
| 1585 |
| 1586 #endif |
| 1587 |
| 1588 /* NPN_PushPopupsEnabledStateUPP */ |
| 1589 |
| 1590 #if _NPUPP_USE_UPP_ |
| 1591 |
| 1592 typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP; |
| 1593 enum { |
| 1594 uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased |
| 1595 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1596 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool))) |
| 1597 | RESULT_SIZE(SIZE_CODE(0)) |
| 1598 }; |
| 1599 |
| 1600 #define NewNPN_PushPopupsEnabledStateProc(FUNC) \ |
| 1601 (NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(F
UNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture()) |
| 1602 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \ |
| 1603 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPop
upsEnabledStateProcInfo, (ARG1), (ARG2)) |
| 1604 |
| 1605 #else |
| 1606 |
| 1607 typedef bool (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled
); |
| 1608 #define NewNPN_PushPopupsEnabledStateProc(FUNC) \ |
| 1609 ((NPN_PushPopupsEnabledStateUPP) (FUNC)) |
| 1610 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \ |
| 1611 (*(FUNC))((ARG1), (ARG2)) |
| 1612 |
| 1613 #endif |
| 1614 |
| 1615 /* NPN_PopPopupsEnabledState */ |
| 1616 |
| 1617 #if _NPUPP_USE_UPP_ |
| 1618 |
| 1619 typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP; |
| 1620 enum { |
| 1621 uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased |
| 1622 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) |
| 1623 | RESULT_SIZE(SIZE_CODE(0)) |
| 1624 }; |
| 1625 |
| 1626 #define NewNPN_PopPopupsEnabledStateProc(FUNC) \ |
| 1627 (NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FU
NC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture()) |
| 1628 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \ |
| 1629 (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopu
psEnabledStateProcInfo, (ARG1)) |
| 1630 |
| 1631 #else |
| 1632 |
| 1633 typedef bool (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp); |
| 1634 #define NewNPN_PopPopupsEnabledStateProc(FUNC) \ |
| 1635 ((NPN_PopPopupsEnabledStateUPP) (FUNC)) |
| 1636 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \ |
| 1637 (*(FUNC))((ARG1)) |
| 1638 |
| 1639 #endif |
| 1640 |
| 1641 |
| 1642 |
| 1643 /*******************************************************************************
*********** |
| 1644 * The actual plugin function table definitions |
| 1645 *******************************************************************************
************/ |
| 1646 |
| 1647 #ifdef XP_MAC |
| 1648 #if PRAGMA_STRUCT_ALIGN |
| 1649 #pragma options align=mac68k |
| 1650 #endif |
| 1651 #endif |
| 1652 |
| 1653 typedef struct _NPPluginFuncs { |
| 1654 uint16 size; |
| 1655 uint16 version; |
| 1656 NPP_NewUPP newp; |
| 1657 NPP_DestroyUPP destroy; |
| 1658 NPP_SetWindowUPP setwindow; |
| 1659 NPP_NewStreamUPP newstream; |
| 1660 NPP_DestroyStreamUPP destroystream; |
| 1661 NPP_StreamAsFileUPP asfile; |
| 1662 NPP_WriteReadyUPP writeready; |
| 1663 NPP_WriteUPP write; |
| 1664 NPP_PrintUPP print; |
| 1665 NPP_HandleEventUPP event; |
| 1666 NPP_URLNotifyUPP urlnotify; |
| 1667 JRIGlobalRef javaClass; |
| 1668 NPP_GetValueUPP getvalue; |
| 1669 NPP_SetValueUPP setvalue; |
| 1670 } NPPluginFuncs; |
| 1671 |
| 1672 typedef struct _NPNetscapeFuncs { |
| 1673 uint16 size; |
| 1674 uint16 version; |
| 1675 NPN_GetURLUPP geturl; |
| 1676 NPN_PostURLUPP posturl; |
| 1677 NPN_RequestReadUPP requestread; |
| 1678 NPN_NewStreamUPP newstream; |
| 1679 NPN_WriteUPP write; |
| 1680 NPN_DestroyStreamUPP destroystream; |
| 1681 NPN_StatusUPP status; |
| 1682 NPN_UserAgentUPP uagent; |
| 1683 NPN_MemAllocUPP memalloc; |
| 1684 NPN_MemFreeUPP memfree; |
| 1685 NPN_MemFlushUPP memflush; |
| 1686 NPN_ReloadPluginsUPP reloadplugins; |
| 1687 NPN_GetJavaEnvUPP getJavaEnv; |
| 1688 NPN_GetJavaPeerUPP getJavaPeer; |
| 1689 NPN_GetURLNotifyUPP geturlnotify; |
| 1690 NPN_PostURLNotifyUPP posturlnotify; |
| 1691 NPN_GetValueUPP getvalue; |
| 1692 NPN_SetValueUPP setvalue; |
| 1693 NPN_InvalidateRectUPP invalidaterect; |
| 1694 NPN_InvalidateRegionUPP invalidateregion; |
| 1695 NPN_ForceRedrawUPP forceredraw; |
| 1696 NPN_GetStringIdentifierUPP getstringidentifier; |
| 1697 NPN_GetStringIdentifiersUPP getstringidentifiers; |
| 1698 NPN_GetIntIdentifierUPP getintidentifier; |
| 1699 NPN_IdentifierIsStringUPP identifierisstring; |
| 1700 NPN_UTF8FromIdentifierUPP utf8fromidentifier; |
| 1701 NPN_IntFromIdentifierUPP intfromidentifier; |
| 1702 NPN_CreateObjectUPP createobject; |
| 1703 NPN_RetainObjectUPP retainobject; |
| 1704 NPN_ReleaseObjectUPP releaseobject; |
| 1705 NPN_InvokeUPP invoke; |
| 1706 NPN_InvokeDefaultUPP invokeDefault; |
| 1707 NPN_EvaluateUPP evaluate; |
| 1708 NPN_GetPropertyUPP getproperty; |
| 1709 NPN_SetPropertyUPP setproperty; |
| 1710 NPN_RemovePropertyUPP removeproperty; |
| 1711 NPN_HasPropertyUPP hasproperty; |
| 1712 NPN_HasMethodUPP hasmethod; |
| 1713 NPN_ReleaseVariantValueUPP releasevariantvalue; |
| 1714 NPN_SetExceptionUPP setexception; |
| 1715 NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate; |
| 1716 NPN_PopPopupsEnabledStateUPP poppopupsenabledstate; |
| 1717 } NPNetscapeFuncs; |
| 1718 |
| 1719 #ifdef XP_MAC |
| 1720 #if PRAGMA_STRUCT_ALIGN |
| 1721 #pragma options align=reset |
| 1722 #endif |
| 1723 #endif |
| 1724 |
| 1725 |
| 1726 #if defined(XP_MAC) || defined(XP_MACOSX) |
| 1727 /*******************************************************************************
*********** |
| 1728 * Mac platform-specific plugin glue stuff |
| 1729 *******************************************************************************
************/ |
| 1730 |
| 1731 /* |
| 1732 * Main entry point of the plugin. |
| 1733 * This routine will be called when the plugin is loaded. The function |
| 1734 * tables are passed in and the plugin fills in the NPPluginFuncs table |
| 1735 * and NPPShutdownUPP for Netscape's use. |
| 1736 */ |
| 1737 |
| 1738 #if _NPUPP_USE_UPP_ |
| 1739 |
| 1740 typedef UniversalProcPtr NPP_MainEntryUPP; |
| 1741 enum { |
| 1742 uppNPP_MainEntryProcInfo = kThinkCStackBased |
| 1743 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))
) |
| 1744 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) |
| 1745 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))
) |
| 1746 | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) |
| 1747 }; |
| 1748 #define NewNPP_MainEntryProc(FUNC) \ |
| 1749 (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_
MainEntryProcInfo, GetCurrentArchitecture()) |
| 1750 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP)
\ |
| 1751 CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP
_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) |
| 1752 |
| 1753 #else |
| 1754 |
| 1755 typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*,
NPP_ShutdownUPP*); |
| 1756 #define NewNPP_MainEntryProc(FUNC) \ |
| 1757 ((NPP_MainEntryUPP) (FUNC)) |
| 1758 #define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP)
\ |
| 1759 (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) |
| 1760 |
| 1761 #endif |
| 1762 |
| 1763 |
| 1764 /* |
| 1765 * Mac version(s) of NP_GetMIMEDescription(const char *) |
| 1766 * These can be called to retreive MIME information from the plugin dynamically |
| 1767 * |
| 1768 * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way |
| 1769 * to get mime info from the plugin only on OSX and may not be supported |
| 1770 * in furture version--use NP_GetMIMEDescription instead |
| 1771 */ |
| 1772 |
| 1773 enum |
| 1774 { |
| 1775 kBPSupportedMIMETypesStructVers_1 = 1 |
| 1776 }; |
| 1777 |
| 1778 typedef struct _BPSupportedMIMETypes |
| 1779 { |
| 1780 SInt32 structVersion; /* struct version */ |
| 1781 Handle typeStrings; /* STR# formated handle, allocated by plug-in */ |
| 1782 Handle infoStrings; /* STR# formated handle, allocated by plug-in */ |
| 1783 } BPSupportedMIMETypes; |
| 1784 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags); |
| 1785 |
| 1786 #if _NPUPP_USE_UPP_ |
| 1787 |
| 1788 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD" |
| 1789 typedef UniversalProcPtr NP_GetMIMEDescriptionUPP; |
| 1790 enum { |
| 1791 uppNP_GetMIMEDescEntryProc = kThinkCStackBased |
| 1792 | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) |
| 1793 }; |
| 1794 #define NewNP_GetMIMEDescEntryProc(FUNC) \ |
| 1795 (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC),
uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture()) |
| 1796 #define CallNP_GetMIMEDescEntryProc(FUNC) \ |
| 1797 (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcI
nfoType)uppNP_GetMIMEDescEntryProc) |
| 1798 |
| 1799 |
| 1800 #else /* !_NPUPP_USE_UPP_ */ |
| 1801 |
| 1802 /* NP_GetMIMEDescription */ |
| 1803 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription" |
| 1804 typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)(); |
| 1805 #define NewNP_GetMIMEDescEntryProc(FUNC) \ |
| 1806 ((NP_GetMIMEDescriptionUPP) (FUNC)) |
| 1807 #define CallNP_GetMIMEDescEntryProc(FUNC) \ |
| 1808 (*(FUNC))() |
| 1809 /* BP_GetSupportedMIMETypes */ |
| 1810 typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, U
Int32); |
| 1811 #define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \ |
| 1812 ((BP_GetSupportedMIMETypesUPP) (FUNC)) |
| 1813 #define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \ |
| 1814 (*(FUNC))((mimeInfo), (flags)) |
| 1815 |
| 1816 #endif |
| 1817 #endif /* MAC */ |
| 1818 |
| 1819 #if defined(_WINDOWS) |
| 1820 #define OSCALL WINAPI |
| 1821 #else |
| 1822 #if defined(__OS2__) |
| 1823 #define OSCALL _System |
| 1824 #else |
| 1825 #define OSCALL |
| 1826 #endif |
| 1827 #endif |
| 1828 |
| 1829 #if defined( _WINDOWS ) || defined (__OS2__) |
| 1830 |
| 1831 #ifdef __cplusplus |
| 1832 extern "C" { |
| 1833 #endif |
| 1834 |
| 1835 /* plugin meta member functions */ |
| 1836 #if defined(__OS2__) |
| 1837 |
| 1838 typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */ |
| 1839 char *pMimeTypes; |
| 1840 char *pFileExtents; |
| 1841 char *pFileOpenTemplate; |
| 1842 char *pProductName; |
| 1843 char *pProductDescription; |
| 1844 unsigned long dwProductVersionMS; |
| 1845 unsigned long dwProductVersionLS; |
| 1846 } NPPluginData; |
| 1847 |
| 1848 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData); |
| 1849 |
| 1850 #endif |
| 1851 |
| 1852 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs); |
| 1853 |
| 1854 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs); |
| 1855 |
| 1856 NPError OSCALL NP_Shutdown(); |
| 1857 |
| 1858 char* NP_GetMIMEDescription(); |
| 1859 |
| 1860 #ifdef __cplusplus |
| 1861 } |
| 1862 #endif |
| 1863 |
| 1864 #endif /* _WINDOWS || __OS2__ */ |
| 1865 |
| 1866 #if defined(__OS2__) |
| 1867 #pragma pack() |
| 1868 #endif |
| 1869 |
| 1870 #ifdef XP_UNIX |
| 1871 |
| 1872 #ifdef __cplusplus |
| 1873 extern "C" { |
| 1874 #endif |
| 1875 |
| 1876 /* plugin meta member functions */ |
| 1877 |
| 1878 char* NP_GetMIMEDescription(void); |
| 1879 NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); |
| 1880 NPError NP_Shutdown(void); |
| 1881 NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue); |
| 1882 |
| 1883 #ifdef __cplusplus |
| 1884 } |
| 1885 #endif |
| 1886 |
| 1887 #endif /* XP_UNIX */ |
| 1888 |
| 1889 #endif /* _NPUPP_H_ */ |
OLD | NEW |