1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 * npapi.h $Revision: 3.46 $ 41 * Netscape client plug-in API spec 42 */ 43 44 #ifndef _NPAPI_H_ 45 #define _NPAPI_H_ 46 47 #ifdef __OS2__ 48 #pragma pack(1) 49 #endif 50 51 #include "prtypes.h" 52 /* Copied from xp_core.h */ 53 /* removed #ifdef for hpux defined in /usr/include/model.h */ 54 #ifndef _INT16 55 #define _INT16 56 #endif 57 #ifndef _INT32 58 #define _INT32 59 #endif 60 #ifndef _UINT16 61 #define _UINT16 62 #endif 63 #ifndef _UINT32 64 #define _UINT32 65 #endif 66 67 /* 68 * NO_NSPR_10_SUPPORT disables the inclusion 69 * of obsolete/protypes.h, whose int16, uint16, 70 * int32, and uint32 typedefs conflict with those 71 * in this file. 72 */ 73 #ifndef NO_NSPR_10_SUPPORT 74 #define NO_NSPR_10_SUPPORT 75 #endif 76 #ifdef OJI 77 #include "jri.h" /* Java Runtime Interface */ 78 #endif 79 80 #if defined (__OS2__ ) || defined (OS2) 81 # ifndef XP_OS2 82 # define XP_OS2 1 83 # endif /* XP_OS2 */ 84 #endif /* __OS2__ */ 85 86 #ifdef _WINDOWS 87 # include <windef.h> 88 # ifndef XP_WIN 89 # define XP_WIN 1 90 # endif /* XP_WIN */ 91 #endif /* _WINDOWS */ 92 93 #ifdef __MWERKS__ 94 # define _declspec __declspec 95 # ifdef __INTEL__ 96 # undef NULL 97 # ifndef XP_WIN 98 # define XP_WIN 1 99 # endif /* XP_WIN */ 100 # endif /* __INTEL__ */ 101 #endif /* __MWERKS__ */ 102 103 #ifdef XP_MACOSX 104 #include <Carbon/Carbon.h> 105 #ifdef __LP64__ 106 #define NP_NO_QUICKDRAW 107 #endif 108 #endif 109 110 #if defined(XP_UNIX) 111 # include <stdio.h> 112 # if defined(MOZ_X11) 113 # include <X11/Xlib.h> 114 # include <X11/Xutil.h> 115 # endif 116 #endif 117 118 /*----------------------------------------------------------------------*/ 119 /* Plugin Version Constants */ 120 /*----------------------------------------------------------------------*/ 121 122 #define NP_VERSION_MAJOR 0 123 #define NP_VERSION_MINOR 19 124 125 126 /* The OS/2 version of Netscape uses RC_DATA to define the 127 mime types, file extensions, etc that are required. 128 Use a vertical bar to separate types, end types with \0. 129 FileVersion and ProductVersion are 32bit ints, all other 130 entries are strings the MUST be terminated wwith a \0. 131 132 AN EXAMPLE: 133 134 RCDATA NP_INFO_ProductVersion { 1,0,0,1,} 135 136 RCDATA NP_INFO_MIMEType { "video/x-video|", 137 "video/x-flick\0" } 138 RCDATA NP_INFO_FileExtents { "avi|", 139 "flc\0" } 140 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|", 141 "MMOS2 Flc/Fli player(*.flc)\0" } 142 143 RCDATA NP_INFO_FileVersion { 1,0,0,1 } 144 RCDATA NP_INFO_CompanyName { "Netscape Communications\0" } 145 RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0" 146 RCDATA NP_INFO_InternalName { "NPAVI32\0" ) 147 RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0" 148 RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" } 149 RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" } 150 151 */ 152 153 154 /* RC_DATA types for version info - required */ 155 #define NP_INFO_ProductVersion 1 156 #define NP_INFO_MIMEType 2 157 #define NP_INFO_FileOpenName 3 158 #define NP_INFO_FileExtents 4 159 160 /* RC_DATA types for version info - used if found */ 161 #define NP_INFO_FileDescription 5 162 #define NP_INFO_ProductName 6 163 164 /* RC_DATA types for version info - optional */ 165 #define NP_INFO_CompanyName 7 166 #define NP_INFO_FileVersion 8 167 #define NP_INFO_InternalName 9 168 #define NP_INFO_LegalCopyright 10 169 #define NP_INFO_OriginalFilename 11 170 171 #ifndef RC_INVOKED 172 173 174 175 /*----------------------------------------------------------------------*/ 176 /* Definition of Basic Types */ 177 /*----------------------------------------------------------------------*/ 178 179 #ifndef _UINT16 180 typedef unsigned short uint16; 181 #endif 182 183 #ifndef _UINT32 184 # if defined(__alpha) || defined(__amd64__) || defined(__x86_64__) 185 typedef unsigned int uint32; 186 # else /* __alpha */ 187 typedef unsigned long uint32; 188 # endif /* __alpha */ 189 #endif 190 191 /* 192 * AIX defines these in sys/inttypes.h included from sys/types.h 193 */ 194 #ifndef AIX 195 #ifndef _INT16 196 typedef short int16; 197 #endif 198 199 #ifndef _INT32 200 # if defined(__alpha) || defined(__amd64__) || defined(__x86_64__) 201 typedef int int32; 202 # else /* __alpha */ 203 typedef long int32; 204 # endif /* __alpha */ 205 #endif 206 #endif 207 208 #ifndef FALSE 209 #define FALSE (0) 210 #endif 211 #ifndef TRUE 212 #define TRUE (1) 213 #endif 214 #ifndef NULL 215 #define NULL (0L) 216 #endif 217 218 #ifdef XP_MACOSX 219 typedef enum { 220 #ifndef NP_NO_QUICKDRAW 221 NPDrawingModelQuickDraw = 0, 222 #endif 223 NPDrawingModelCoreGraphics = 1 224 } NPDrawingModel; 225 #endif 226 227 typedef unsigned char NPBool; 228 typedef int16 NPError; 229 typedef int16 NPReason; 230 typedef char* NPMIMEType; 231 232 233 234 /*----------------------------------------------------------------------*/ 235 /* Structures and definitions */ 236 /*----------------------------------------------------------------------*/ 237 238 /* 239 * NPP is a plug-in's opaque instance handle 240 */ 241 typedef struct _NPP 242 { 243 void* pdata; /* plug-in private data */ 244 void* ndata; /* netscape private data */ 245 } NPP_t; 246 247 typedef NPP_t* NPP; 248 249 250 typedef struct _NPStream 251 { 252 void* pdata; /* plug-in private data */ 253 void* ndata; /* netscape private data */ 254 const char* url; 255 uint32 end; 256 uint32 lastmodified; 257 void* notifyData; 258 const char* headers; /* Response headers from host. 259 * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS. 260 * Used for HTTP only; NULL for non-HTTP. 261 * Available from NPP_NewStream onwards. 262 * Plugin should copy this data before storing it. 263 * Includes HTTP status line and all headers, 264 * preferably verbatim as received from server, 265 * headers formatted as in HTTP ("Header: Value"), 266 * and newlines (\n, NOT \r\n) separating lines. 267 * Terminated by \n\0 (NOT \n\n\0). */ 268 } NPStream; 269 270 271 typedef struct _NPByteRange 272 { 273 int32 offset; /* negative offset means from the end */ 274 uint32 length; 275 struct _NPByteRange* next; 276 } NPByteRange; 277 278 279 typedef struct _NPSavedData 280 { 281 int32 len; 282 void* buf; 283 } NPSavedData; 284 285 286 typedef struct _NPRect 287 { 288 uint16 top; 289 uint16 left; 290 uint16 bottom; 291 uint16 right; 292 } NPRect; 293 294 typedef struct _NPSize 295 { 296 int32 width; 297 int32 height; 298 } NPSize; 299 300 #ifdef XP_UNIX 301 /* 302 * Unix specific structures and definitions 303 */ 304 305 /* 306 * Callback Structures. 307 * 308 * These are used to pass additional platform specific information. 309 */ 310 enum { 311 NP_SETWINDOW = 1, 312 NP_PRINT 313 }; 314 315 typedef struct 316 { 317 int32 type; 318 } NPAnyCallbackStruct; 319 320 typedef struct 321 { 322 int32 type; 323 #ifdef MOZ_X11 324 Display* display; 325 Visual* visual; 326 Colormap colormap; 327 unsigned int depth; 328 #endif 329 } NPSetWindowCallbackStruct; 330 331 typedef struct 332 { 333 int32 type; 334 FILE* fp; 335 } NPPrintCallbackStruct; 336 337 #endif /* XP_UNIX */ 338 339 340 /* 341 * The following masks are applied on certain platforms to NPNV and 342 * NPPV selectors that pass around pointers to COM interfaces. Newer 343 * compilers on some platforms may generate vtables that are not 344 * compatible with older compilers. To prevent older plugins from 345 * not understanding a new browser's ABI, these masks change the 346 * values of those selectors on those platforms. To remain backwards 347 * compatible with differenet versions of the browser, plugins can 348 * use these masks to dynamically determine and use the correct C++ 349 * ABI that the browser is expecting. This does not apply to Windows 350 * as Microsoft's COM ABI will likely not change. 351 */ 352 353 #define NP_ABI_GCC3_MASK 0x10000000 354 /* 355 * gcc 3.x generated vtables on UNIX and OSX are incompatible with 356 * previous compilers. 357 */ 358 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) 359 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK 360 #else 361 #define _NP_ABI_MIXIN_FOR_GCC3 0 362 #endif 363 364 365 #define NP_ABI_MACHO_MASK 0x01000000 366 /* 367 * On OSX, the Mach-O executable format is significantly 368 * different than CFM. In addition to having a different 369 * C++ ABI, it also has has different C calling convention. 370 * You must use glue code when calling between CFM and 371 * Mach-O C functions. 372 */ 373 #if (defined(TARGET_RT_MAC_MACHO)) 374 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK 375 #else 376 #define _NP_ABI_MIXIN_FOR_MACHO 0 377 #endif 378 379 380 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO) 381 382 /* 383 * List of variable names for which NPP_GetValue shall be implemented 384 */ 385 typedef enum { 386 NPPVpluginNameString = 1, 387 NPPVpluginDescriptionString, 388 NPPVpluginWindowBool, 389 NPPVpluginTransparentBool, 390 NPPVjavaClass, /* Not implemented in Mozilla 1.0 */ 391 NPPVpluginWindowSize, 392 NPPVpluginTimerInterval, 393 394 NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), 395 NPPVpluginScriptableIID = 11, 396 397 /* Introduced in Mozilla 0.9.9 */ 398 NPPVjavascriptPushCallerBool = 12, 399 400 /* Introduced in Mozilla 1.0 */ 401 NPPVpluginKeepLibraryInMemory = 13, 402 NPPVpluginNeedsXEmbed = 14, 403 404 /* Get the NPObject for scripting the plugin. Introduced in Firefox 405 * 1.0 (NPAPI minor version 14). 406 */ 407 NPPVpluginScriptableNPObject = 15, 408 409 /* Get the plugin value (as \0-terminated UTF-8 string data) for 410 * form submission if the plugin is part of a form. Use 411 * NPN_MemAlloc() to allocate memory for the string data. Introduced 412 * in Mozilla 1.8b2 (NPAPI minor version 15). 413 */ 414 NPPVformValue = 16 415 } NPPVariable; 416 417 /* 418 * List of variable names for which NPN_GetValue is implemented by Mozilla 419 */ 420 typedef enum { 421 NPNVxDisplay = 1, 422 NPNVxtAppContext, 423 NPNVnetscapeWindow, 424 NPNVjavascriptEnabledBool, 425 NPNVasdEnabledBool, 426 NPNVisOfflineBool, 427 428 /* 10 and over are available on Mozilla builds starting with 0.9.4 */ 429 NPNVserviceManager = (10 | NP_ABI_MASK), 430 NPNVDOMElement = (11 | NP_ABI_MASK), /* available in Mozilla 1.2 */ 431 NPNVDOMWindow = (12 | NP_ABI_MASK), 432 NPNVToolkit = (13 | NP_ABI_MASK), 433 NPNVSupportsXEmbedBool = 14, 434 435 /* Get the NPObject wrapper for the browser window. */ 436 NPNVWindowNPObject = 15, 437 438 /* Get the NPObject wrapper for the plugins DOM element. */ 439 NPNVPluginElementNPObject = 16 440 441 #ifdef XP_MACOSX 442 /* Used for negotiating drawing models */ 443 , NPNVpluginDrawingModel = 1000 444 #ifndef NP_NO_QUICKDRAW 445 , NPNVsupportsQuickDrawBool = 2000 446 #endif 447 , NPNVsupportsCoreGraphicsBool = 2001 448 #endif 449 } NPNVariable; 450 451 /* 452 * The type of Tookkit the widgets use 453 */ 454 typedef enum { 455 NPNVGtk12 = 1, 456 NPNVGtk2 457 } NPNToolkitType; 458 459 /* 460 * The type of a NPWindow - it specifies the type of the data structure 461 * returned in the window field. 462 */ 463 typedef enum { 464 NPWindowTypeWindow = 1, 465 NPWindowTypeDrawable 466 } NPWindowType; 467 468 typedef struct _NPWindow 469 { 470 void* window; /* Platform specific window handle */ 471 /* OS/2: x - Position of bottom left corner */ 472 /* OS/2: y - relative to visible netscape window */ 473 int32 x; /* Position of top left corner relative */ 474 int32 y; /* to a netscape page. */ 475 uint32 width; /* Maximum window size */ 476 uint32 height; 477 NPRect clipRect; /* Clipping rectangle in port coordinates */ 478 /* Used by MAC only. */ 479 #if defined(XP_UNIX) && !defined(XP_MACOSX) 480 void * ws_info; /* Platform-dependent additonal data */ 481 #endif /* XP_UNIX */ 482 NPWindowType type; /* Is this a window or a drawable? */ 483 } NPWindow; 484 485 486 typedef struct _NPFullPrint 487 { 488 NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */ 489 NPBool printOne; /* TRUE if plugin should print one copy to default printer */ 490 void* platformPrint; /* Platform-specific printing info */ 491 } NPFullPrint; 492 493 typedef struct _NPEmbedPrint 494 { 495 NPWindow window; 496 void* platformPrint; /* Platform-specific printing info */ 497 } NPEmbedPrint; 498 499 typedef struct _NPPrint 500 { 501 uint16 mode; /* NP_FULL or NP_EMBED */ 502 union 503 { 504 NPFullPrint fullPrint; /* if mode is NP_FULL */ 505 NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ 506 } print; 507 } NPPrint; 508 509 #ifdef XP_MACOSX 510 typedef EventRecord NPEvent; 511 #elif defined(XP_WIN) 512 typedef struct _NPEvent 513 { 514 uint16 event; 515 uint32 wParam; 516 uint32 lParam; 517 } NPEvent; 518 #elif defined(XP_OS2) 519 typedef struct _NPEvent 520 { 521 uint32 event; 522 uint32 wParam; 523 uint32 lParam; 524 } NPEvent; 525 #elif defined (XP_UNIX) && defined(MOZ_X11) 526 typedef XEvent NPEvent; 527 #else 528 typedef void* NPEvent; 529 #endif /* XP_MACOSX */ 530 531 #ifdef XP_MACOSX 532 typedef void* NPRegion; 533 #ifndef NP_NO_QUICKDRAW 534 typedef RgnHandle NPQDRegion; 535 #endif 536 typedef CGPathRef NPCGRegion; 537 #elif defined(XP_WIN) 538 typedef HRGN NPRegion; 539 #elif defined(XP_UNIX) && defined(MOZ_X11) 540 typedef Region NPRegion; 541 #else 542 typedef void *NPRegion; 543 #endif /* XP_MACOSX */ 544 545 #ifdef XP_MACOSX 546 /* 547 * Mac-specific structures and definitions. 548 */ 549 550 typedef struct NP_Port 551 { 552 CGrafPtr port; /* Grafport */ 553 int32 portx; /* position inside the topmost window */ 554 int32 porty; 555 } NP_Port; 556 557 typedef struct NP_CGContext 558 { 559 CGContextRef context; 560 WindowRef window; 561 } NP_CGContext; 562 563 /* 564 * Non-standard event types that can be passed to HandleEvent 565 */ 566 567 enum NPEventType { 568 NPEventType_GetFocusEvent = (osEvt + 16), 569 NPEventType_LoseFocusEvent, 570 NPEventType_AdjustCursorEvent, 571 NPEventType_MenuCommandEvent, 572 NPEventType_ClippingChangedEvent, 573 NPEventType_ScrollingBeginsEvent = 1000, 574 NPEventType_ScrollingEndsEvent 575 }; 576 577 #ifdef OBSOLETE 578 #define getFocusEvent (osEvt + 16) 579 #define loseFocusEvent (osEvt + 17) 580 #define adjustCursorEvent (osEvt + 18) 581 #endif 582 #endif /* XP_MACOSX */ 583 584 /* 585 * Values for mode passed to NPP_New: 586 */ 587 #define NP_EMBED 1 588 #define NP_FULL 2 589 590 /* 591 * Values for stream type passed to NPP_NewStream: 592 */ 593 #define NP_NORMAL 1 594 #define NP_SEEK 2 595 #define NP_ASFILE 3 596 #define NP_ASFILEONLY 4 597 598 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1) 599 600 601 /*----------------------------------------------------------------------*/ 602 /* Error and Reason Code definitions */ 603 /*----------------------------------------------------------------------*/ 604 605 /* 606 * Values of type NPError: 607 */ 608 #define NPERR_BASE 0 609 #define NPERR_NO_ERROR (NPERR_BASE + 0) 610 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1) 611 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) 612 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) 613 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) 614 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) 615 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) 616 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) 617 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) 618 #define NPERR_INVALID_PARAM (NPERR_BASE + 9) 619 #define NPERR_INVALID_URL (NPERR_BASE + 10) 620 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) 621 #define NPERR_NO_DATA (NPERR_BASE + 12) 622 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) 623 624 /* 625 * Values of type NPReason: 626 */ 627 #define NPRES_BASE 0 628 #define NPRES_DONE (NPRES_BASE + 0) 629 #define NPRES_NETWORK_ERR (NPRES_BASE + 1) 630 #define NPRES_USER_BREAK (NPRES_BASE + 2) 631 632 /* 633 * Don't use these obsolete error codes any more. 634 */ 635 #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR 636 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR 637 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK 638 639 /* 640 * Version feature information 641 */ 642 #define NPVERS_HAS_STREAMOUTPUT 8 643 #define NPVERS_HAS_NOTIFICATION 9 644 #define NPVERS_HAS_LIVECONNECT 9 645 #define NPVERS_WIN16_HAS_LIVECONNECT 9 646 #define NPVERS_68K_HAS_LIVECONNECT 11 647 #define NPVERS_HAS_WINDOWLESS 11 648 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13 649 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 650 #define NPVERS_HAS_FORM_VALUES 15 651 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16 652 #define NPVERS_HAS_RESPONSE_HEADERS 17 653 #define NPVERS_HAS_NPOBJECT_ENUM 18 654 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19 655 656 /*----------------------------------------------------------------------*/ 657 /* Function Prototypes */ 658 /*----------------------------------------------------------------------*/ 659 660 #if defined(_WINDOWS) && !defined(WIN32) 661 #define NP_LOADDS _loadds 662 #else 663 #if defined(__OS2__) 664 #define NP_LOADDS _System 665 #else 666 #define NP_LOADDS 667 #endif 668 #endif 669 670 #ifdef __cplusplus 671 extern "C" { 672 #endif 673 674 /* 675 * NPP_* functions are provided by the plugin and called by the navigator. 676 */ 677 678 #ifdef XP_UNIX 679 char* NPP_GetMIMEDescription(void); 680 #endif /* XP_UNIX */ 681 682 NPError NP_LOADDS NPP_Initialize(void); 683 void NP_LOADDS NPP_Shutdown(void); 684 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, 685 uint16 mode, int16 argc, char* argn[], 686 char* argv[], NPSavedData* saved); 687 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); 688 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); 689 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, 690 NPStream* stream, NPBool seekable, 691 uint16* stype); 692 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, 693 NPReason reason); 694 int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); 695 int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, 696 int32 len, void* buffer); 697 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, 698 const char* fname); 699 void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); 700 int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event); 701 void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, 702 NPReason reason, void* notifyData); 703 #ifdef OJI 704 jref NP_LOADDS NPP_GetJavaClass(void); 705 #endif 706 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value); 707 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value); 708 709 /* 710 * NPN_* functions are provided by the navigator and called by the plugin. 711 */ 712 void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor, 713 int* netscape_major, int* netscape_minor); 714 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url, 715 const char* target, void* notifyData); 716 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url, 717 const char* target); 718 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url, 719 const char* target, uint32 len, 720 const char* buf, NPBool file, 721 void* notifyData); 722 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url, 723 const char* target, uint32 len, 724 const char* buf, NPBool file); 725 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); 726 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, 727 const char* target, NPStream** stream); 728 int32 NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer); 729 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason); 730 void NP_LOADDS NPN_Status(NPP instance, const char* message); 731 const char* NP_LOADDS NPN_UserAgent(NPP instance); 732 void* NP_LOADDS NPN_MemAlloc(uint32 size); 733 void NP_LOADDS NPN_MemFree(void* ptr); 734 uint32 NP_LOADDS NPN_MemFlush(uint32 size); 735 void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages); 736 #ifdef OJI 737 JRIEnv* NP_LOADDS NPN_GetJavaEnv(void); 738 jref NP_LOADDS NPN_GetJavaPeer(NPP instance); 739 #endif 740 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value); 741 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value); 742 void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect); 743 void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion); 744 void NP_LOADDS NPN_ForceRedraw(NPP instance); 745 //jam changed two functions below to return bool 746 bool NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled); 747 bool NP_LOADDS NPN_PopPopupsEnabledState(NPP instance); 748 void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance, 749 void (*func) (void *), 750 void *userData); 751 752 #ifdef __cplusplus 753 } /* end extern "C" */ 754 #endif 755 756 #endif /* RC_INVOKED */ 757 #ifdef __OS2__ 758 #pragma pack() 759 #endif 760 761 #endif /* _NPAPI_H_ */ 762