Back to index

lightning-sunbird  0.9+nobinonly
npapi.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 
00039 /*
00040  *  npapi.h $Revision: 3.40.4.2 $
00041  *  Netscape client plug-in API spec
00042  */
00043 
00044 #ifndef _NPAPI_H_
00045 #define _NPAPI_H_
00046 
00047 #ifdef __OS2__
00048 #pragma pack(1)
00049 #endif
00050 
00051 #include "prtypes.h"
00052 /* Copied from xp_core.h */
00053 /* removed #ifdef for hpux defined in /usr/include/model.h */
00054 #ifndef XP_MAC
00055 #ifndef _INT16
00056 #define _INT16
00057 #endif
00058 #ifndef _INT32
00059 #define _INT32
00060 #endif
00061 #ifndef _UINT16
00062 #define _UINT16
00063 #endif
00064 #ifndef _UINT32
00065 #define _UINT32
00066 #endif
00067 #endif
00068 
00069 /* 
00070  * NO_NSPR_10_SUPPORT disables the inclusion 
00071  * of obsolete/protypes.h, whose int16, uint16, 
00072  * int32, and uint32 typedefs conflict with those 
00073  * in this file. 
00074  */ 
00075 #ifndef NO_NSPR_10_SUPPORT
00076 #define NO_NSPR_10_SUPPORT
00077 #endif
00078 #ifdef OJI
00079 #include "jri.h"                /* Java Runtime Interface */
00080 #endif
00081 
00082 #if defined (__OS2__ ) || defined (OS2)
00083 #      ifndef XP_OS2
00084 #             define XP_OS2 1
00085 #      endif /* XP_OS2 */
00086 #endif /* __OS2__ */
00087 
00088 #ifdef _WINDOWS
00089 #      include <windef.h>
00090 #      ifndef XP_WIN
00091 #             define XP_WIN 1
00092 #      endif /* XP_WIN */
00093 #endif /* _WINDOWS */
00094 
00095 #ifdef __MWERKS__
00096 #      define _declspec __declspec
00097 #      ifdef macintosh
00098 #             ifndef XP_MAC
00099 #                    define XP_MAC 1
00100 #             endif /* XP_MAC */
00101 #      endif /* macintosh */
00102 #      ifdef __INTEL__
00103 #             undef NULL
00104 #             ifndef XP_WIN
00105 #                    define XP_WIN 1
00106 #             endif /* XP_WIN */
00107 #      endif /* __INTEL__ */
00108 #endif /* __MWERKS__ */
00109 
00110 #if defined(XP_MAC) || defined(XP_MACOSX)
00111        #include <Quickdraw.h>
00112        #include <Events.h>
00113 #endif
00114 
00115 #if defined(XP_UNIX) 
00116 #      include <stdio.h>
00117 #      if defined(MOZ_X11)
00118 #             include <X11/Xlib.h>
00119 #             include <X11/Xutil.h>
00120 #      endif
00121 #endif
00122 
00123 /*----------------------------------------------------------------------*/
00124 /*                        Plugin Version Constants                      */
00125 /*----------------------------------------------------------------------*/
00126 
00127 #define NP_VERSION_MAJOR 0
00128 #define NP_VERSION_MINOR 17
00129 
00130 
00131 /* The OS/2 version of Netscape uses RC_DATA to define the
00132    mime types, file extensions, etc that are required.
00133    Use a vertical bar to separate types, end types with \0.
00134    FileVersion and ProductVersion are 32bit ints, all other
00135    entries are strings the MUST be terminated wwith a \0.
00136 
00137 AN EXAMPLE:
00138 
00139 RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
00140 
00141 RCDATA NP_INFO_MIMEType    { "video/x-video|",
00142                              "video/x-flick\0" }
00143 RCDATA NP_INFO_FileExtents { "avi|",
00144                              "flc\0" }
00145 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
00146                              "MMOS2 Flc/Fli player(*.flc)\0" }
00147 
00148 RCDATA NP_INFO_FileVersion       { 1,0,0,1 }
00149 RCDATA NP_INFO_CompanyName       { "Netscape Communications\0" }
00150 RCDATA NP_INFO_FileDescription   { "NPAVI32 Extension DLL\0"
00151 RCDATA NP_INFO_InternalName      { "NPAVI32\0" )
00152 RCDATA NP_INFO_LegalCopyright    { "Copyright Netscape Communications \251 1996\0"
00153 RCDATA NP_INFO_OriginalFilename  { "NVAPI32.DLL" }
00154 RCDATA NP_INFO_ProductName       { "NPAVI32 Dynamic Link Library\0" }
00155 
00156 */
00157 
00158 
00159 /* RC_DATA types for version info - required */
00160 #define NP_INFO_ProductVersion      1
00161 #define NP_INFO_MIMEType            2
00162 #define NP_INFO_FileOpenName        3
00163 #define NP_INFO_FileExtents         4
00164 
00165 /* RC_DATA types for version info - used if found */
00166 #define NP_INFO_FileDescription     5
00167 #define NP_INFO_ProductName         6
00168 
00169 /* RC_DATA types for version info - optional */
00170 #define NP_INFO_CompanyName         7
00171 #define NP_INFO_FileVersion         8
00172 #define NP_INFO_InternalName        9
00173 #define NP_INFO_LegalCopyright      10
00174 #define NP_INFO_OriginalFilename    11
00175 
00176 #ifndef RC_INVOKED
00177 
00178 
00179 
00180 /*----------------------------------------------------------------------*/
00181 /*                       Definition of Basic Types                      */
00182 /*----------------------------------------------------------------------*/
00183 
00184 #ifndef _UINT16
00185 typedef unsigned short uint16;
00186 #endif
00187 
00188 #ifndef _UINT32
00189 #    if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
00190 typedef unsigned int uint32;
00191 #    else  /* __alpha */
00192 typedef unsigned long uint32;
00193 #    endif /* __alpha */
00194 #endif
00195 
00196 /*
00197  * AIX defines these in sys/inttypes.h included from sys/types.h
00198  */
00199 #ifndef AIX
00200 #ifndef _INT16
00201 typedef short int16;
00202 #endif
00203 
00204 #ifndef _INT32
00205 #    if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
00206 typedef int int32;
00207 #    else  /* __alpha */
00208 typedef long int32;
00209 #    endif /* __alpha */
00210 #endif
00211 #endif
00212 
00213 #ifndef FALSE
00214 #define FALSE (0)
00215 #endif
00216 #ifndef TRUE
00217 #define TRUE (1)
00218 #endif
00219 #ifndef NULL
00220 #define NULL (0L)
00221 #endif
00222 
00223 typedef unsigned char       NPBool;
00224 typedef int16               NPError;
00225 typedef int16               NPReason;
00226 typedef char*               NPMIMEType;
00227 
00228 
00229 
00230 /*----------------------------------------------------------------------*/
00231 /*                       Structures and definitions                     */
00232 /*----------------------------------------------------------------------*/
00233 
00234 #ifdef XP_MAC
00235 #pragma options align=mac68k
00236 #endif
00237 
00238 /*
00239  *  NPP is a plug-in's opaque instance handle
00240  */
00241 typedef struct _NPP
00242 {
00243   void*       pdata;      /* plug-in private data */
00244   void*       ndata;      /* netscape private data */
00245 } NPP_t;
00246 
00247 typedef NPP_t*  NPP;
00248 
00249 
00250 typedef struct _NPStream
00251 {
00252   void*  pdata; /* plug-in private data */
00253   void*  ndata; /* netscape private data */
00254   const  char* url;
00255   uint32 end;
00256   uint32 lastmodified;
00257   void*  notifyData;
00258   const  char* headers; /* Response headers from host.
00259                          * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
00260                          * Used for HTTP only; NULL for non-HTTP.
00261                          * Available from NPP_NewStream onwards.
00262                          * Plugin should copy this data before storing it.
00263                          * Includes HTTP status line and all headers,
00264                          * preferably verbatim as received from server,
00265                          * headers formatted as in HTTP ("Header: Value"),
00266                          * and newlines (\n, NOT \r\n) separating lines.
00267                          * Terminated by \n\0 (NOT \n\n\0). */
00268 } NPStream;
00269 
00270 
00271 typedef struct _NPByteRange
00272 {
00273   int32  offset; /* negative offset means from the end */
00274   uint32 length;
00275   struct _NPByteRange* next;
00276 } NPByteRange;
00277 
00278 
00279 typedef struct _NPSavedData
00280 {
00281   int32       len;
00282   void*       buf;
00283 } NPSavedData;
00284 
00285 
00286 typedef struct _NPRect
00287 {
00288   uint16 top;
00289   uint16 left;
00290   uint16 bottom;
00291   uint16 right;
00292 } NPRect;
00293 
00294 typedef struct _NPSize 
00295 { 
00296   int32 width; 
00297   int32 height; 
00298 } NPSize; 
00299 
00300 #ifdef XP_UNIX
00301 /*
00302  * Unix specific structures and definitions
00303  */
00304 
00305 /*
00306  * Callback Structures.
00307  *
00308  * These are used to pass additional platform specific information.
00309  */
00310 enum {
00311   NP_SETWINDOW = 1,
00312   NP_PRINT
00313 };
00314 
00315 typedef struct
00316 {
00317   int32 type;
00318 } NPAnyCallbackStruct;
00319 
00320 typedef struct
00321 {
00322   int32        type;
00323 #ifdef MOZ_X11
00324   Display*     display;
00325   Visual*      visual;
00326   Colormap     colormap;
00327   unsigned int depth;
00328 #endif
00329 } NPSetWindowCallbackStruct;
00330 
00331 typedef struct
00332 {
00333   int32 type;
00334   FILE* fp;
00335 } NPPrintCallbackStruct;
00336 
00337 #endif /* XP_UNIX */
00338 
00339 
00340 /*
00341  *   The following masks are applied on certain platforms to NPNV and 
00342  *   NPPV selectors that pass around pointers to COM interfaces. Newer 
00343  *   compilers on some platforms may generate vtables that are not 
00344  *   compatible with older compilers. To prevent older plugins from 
00345  *   not understanding a new browser's ABI, these masks change the 
00346  *   values of those selectors on those platforms. To remain backwards
00347  *   compatible with differenet versions of the browser, plugins can 
00348  *   use these masks to dynamically determine and use the correct C++
00349  *   ABI that the browser is expecting. This does not apply to Windows 
00350  *   as Microsoft's COM ABI will likely not change.
00351  */
00352 
00353 #define NP_ABI_GCC3_MASK  0x10000000
00354 /*
00355  *   gcc 3.x generated vtables on UNIX and OSX are incompatible with 
00356  *   previous compilers.
00357  */
00358 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
00359 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
00360 #else
00361 #define _NP_ABI_MIXIN_FOR_GCC3 0
00362 #endif
00363 
00364 
00365 #define NP_ABI_MACHO_MASK 0x01000000
00366 /*
00367  *   On OSX, the Mach-O executable format is significantly
00368  *   different than CFM. In addition to having a different
00369  *   C++ ABI, it also has has different C calling convention.
00370  *   You must use glue code when calling between CFM and
00371  *   Mach-O C functions. 
00372  */
00373 #if (defined(TARGET_RT_MAC_MACHO))
00374 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
00375 #else
00376 #define _NP_ABI_MIXIN_FOR_MACHO 0
00377 #endif
00378 
00379 
00380 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
00381 
00382 /*
00383  * List of variable names for which NPP_GetValue shall be implemented
00384  */
00385 typedef enum {
00386   NPPVpluginNameString = 1,
00387   NPPVpluginDescriptionString,
00388   NPPVpluginWindowBool,
00389   NPPVpluginTransparentBool,
00390   NPPVjavaClass,                /* Not implemented in Mozilla 1.0 */
00391   NPPVpluginWindowSize,
00392   NPPVpluginTimerInterval,
00393 
00394   NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
00395   NPPVpluginScriptableIID = 11,
00396 
00397   /* Introduced in Mozilla 0.9.9 */
00398   NPPVjavascriptPushCallerBool = 12,
00399 
00400   /* Introduced in Mozilla 1.0 */
00401   NPPVpluginKeepLibraryInMemory = 13,
00402   NPPVpluginNeedsXEmbed         = 14,
00403 
00404   /* Get the NPObject for scripting the plugin. Introduced in Firefox
00405    * 1.0 (NPAPI minor version 14).
00406    */
00407   NPPVpluginScriptableNPObject  = 15,
00408 
00409   /* Get the plugin value (as \0-terminated UTF-8 string data) for
00410    * form submission if the plugin is part of a form. Use
00411    * NPN_MemAlloc() to allocate memory for the string data. Introduced
00412    * in Mozilla 1.8b2 (NPAPI minor version 15).
00413    */
00414   NPPVformValue = 16
00415 } NPPVariable;
00416 
00417 /*
00418  * List of variable names for which NPN_GetValue is implemented by Mozilla
00419  */
00420 typedef enum {
00421   NPNVxDisplay = 1,
00422   NPNVxtAppContext,
00423   NPNVnetscapeWindow,
00424   NPNVjavascriptEnabledBool,
00425   NPNVasdEnabledBool,
00426   NPNVisOfflineBool,
00427 
00428   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
00429   NPNVserviceManager = (10 | NP_ABI_MASK),
00430   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
00431   NPNVDOMWindow      = (12 | NP_ABI_MASK),
00432   NPNVToolkit        = (13 | NP_ABI_MASK),
00433   NPNVSupportsXEmbedBool = 14,
00434 
00435   /* Get the NPObject wrapper for the browser window. */
00436   NPNVWindowNPObject = 15,
00437 
00438   /* Get the NPObject wrapper for the plugins DOM element. */
00439   NPNVPluginElementNPObject = 16
00440 } NPNVariable;
00441 
00442 /*
00443  * The type of Tookkit the widgets use
00444  */
00445 typedef enum {
00446   NPNVGtk12 = 1,
00447   NPNVGtk2
00448 } NPNToolkitType;
00449 
00450 /*
00451  * The type of a NPWindow - it specifies the type of the data structure
00452  * returned in the window field.
00453  */
00454 typedef enum {
00455   NPWindowTypeWindow = 1,
00456   NPWindowTypeDrawable
00457 } NPWindowType;
00458 
00459 typedef struct _NPWindow
00460 {
00461   void* window;  /* Platform specific window handle */
00462                  /* OS/2: x - Position of bottom left corner  */
00463                  /* OS/2: y - relative to visible netscape window */
00464   int32 x;       /* Position of top left corner relative */
00465   int32 y;       /* to a netscape page.                               */
00466   uint32 width;  /* Maximum window size */
00467   uint32 height;
00468   NPRect clipRect; /* Clipping rectangle in port coordinates */
00469                    /* Used by MAC only.                   */
00470 #if defined(XP_UNIX) && !defined(XP_MACOSX)
00471   void * ws_info; /* Platform-dependent additonal data */
00472 #endif /* XP_UNIX */
00473   NPWindowType type; /* Is this a window or a drawable? */
00474 } NPWindow;
00475 
00476 
00477 typedef struct _NPFullPrint
00478 {
00479   NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
00480   NPBool printOne;           /* TRUE if plugin should print one copy to default printer */
00481   void* platformPrint; /* Platform-specific printing info */
00482 } NPFullPrint;
00483 
00484 typedef struct _NPEmbedPrint
00485 {
00486   NPWindow window;
00487   void* platformPrint; /* Platform-specific printing info */
00488 } NPEmbedPrint;
00489 
00490 typedef struct _NPPrint
00491 {
00492   uint16 mode;               /* NP_FULL or NP_EMBED */
00493   union
00494   {
00495     NPFullPrint fullPrint;   /* if mode is NP_FULL */
00496     NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
00497   } print;
00498 } NPPrint;
00499 
00500 #if defined(XP_MAC) || defined(XP_MACOSX)
00501 typedef EventRecord  NPEvent;
00502 #elif defined(XP_WIN)
00503 typedef struct _NPEvent
00504 {
00505   uint16 event;
00506   uint32 wParam;
00507   uint32 lParam;
00508 } NPEvent;
00509 #elif defined(XP_OS2)
00510 typedef struct _NPEvent
00511 {
00512   uint32 event;
00513   uint32 wParam;
00514   uint32 lParam;
00515 } NPEvent;
00516 #elif defined (XP_UNIX) && defined(MOZ_X11)
00517 typedef XEvent NPEvent;
00518 #else
00519 typedef void*               NPEvent;
00520 #endif /* XP_MAC */
00521 
00522 #if defined(XP_MAC) || defined(XP_MACOSX)
00523 typedef RgnHandle NPRegion;
00524 #elif defined(XP_WIN)
00525 typedef HRGN NPRegion;
00526 #elif defined(XP_UNIX) && defined(MOZ_X11)
00527 typedef Region NPRegion;
00528 #else
00529 typedef void *NPRegion;
00530 #endif /* XP_MAC */
00531 
00532 #if defined(XP_MAC) || defined(XP_MACOSX)
00533 /*
00534  *  Mac-specific structures and definitions.
00535  */
00536 
00537 typedef struct NP_Port
00538 {
00539   CGrafPtr port; /* Grafport */
00540   int32 portx;   /* position inside the topmost window */
00541   int32 porty;
00542 } NP_Port;
00543 
00544 /*
00545  *  Non-standard event types that can be passed to HandleEvent
00546  */
00547 
00548 enum NPEventType {
00549   NPEventType_GetFocusEvent = (osEvt + 16),
00550   NPEventType_LoseFocusEvent,
00551   NPEventType_AdjustCursorEvent,
00552   NPEventType_MenuCommandEvent,
00553   NPEventType_ClippingChangedEvent,
00554   NPEventType_ScrollingBeginsEvent = 1000,
00555   NPEventType_ScrollingEndsEvent
00556 };
00557 
00558 #ifdef OBSOLETE
00559 #define getFocusEvent     (osEvt + 16)
00560 #define loseFocusEvent    (osEvt + 17)
00561 #define adjustCursorEvent (osEvt + 18)
00562 #endif
00563 #endif /* XP_MAC */
00564 
00565 /*
00566  * Values for mode passed to NPP_New:
00567  */
00568 #define NP_EMBED 1
00569 #define NP_FULL  2
00570 
00571 /*
00572  * Values for stream type passed to NPP_NewStream:
00573  */
00574 #define NP_NORMAL     1
00575 #define NP_SEEK       2
00576 #define NP_ASFILE     3
00577 #define NP_ASFILEONLY 4
00578 
00579 #define NP_MAXREADY  (((unsigned)(~0)<<1)>>1)
00580 
00581 #ifdef XP_MAC
00582 #pragma options align=reset
00583 #endif
00584 
00585 
00586 /*----------------------------------------------------------------------*/
00587 /*                 Error and Reason Code definitions                  */
00588 /*----------------------------------------------------------------------*/
00589 
00590 /*
00591  * Values of type NPError:
00592  */
00593 #define NPERR_BASE                         0
00594 #define NPERR_NO_ERROR                    (NPERR_BASE + 0)
00595 #define NPERR_GENERIC_ERROR               (NPERR_BASE + 1)
00596 #define NPERR_INVALID_INSTANCE_ERROR      (NPERR_BASE + 2)
00597 #define NPERR_INVALID_FUNCTABLE_ERROR     (NPERR_BASE + 3)
00598 #define NPERR_MODULE_LOAD_FAILED_ERROR    (NPERR_BASE + 4)
00599 #define NPERR_OUT_OF_MEMORY_ERROR         (NPERR_BASE + 5)
00600 #define NPERR_INVALID_PLUGIN_ERROR        (NPERR_BASE + 6)
00601 #define NPERR_INVALID_PLUGIN_DIR_ERROR    (NPERR_BASE + 7)
00602 #define NPERR_INCOMPATIBLE_VERSION_ERROR  (NPERR_BASE + 8)
00603 #define NPERR_INVALID_PARAM               (NPERR_BASE + 9)
00604 #define NPERR_INVALID_URL                 (NPERR_BASE + 10)
00605 #define NPERR_FILE_NOT_FOUND              (NPERR_BASE + 11)
00606 #define NPERR_NO_DATA                     (NPERR_BASE + 12)
00607 #define NPERR_STREAM_NOT_SEEKABLE         (NPERR_BASE + 13)
00608 
00609 /*
00610  * Values of type NPReason:
00611  */
00612 #define NPRES_BASE          0
00613 #define NPRES_DONE         (NPRES_BASE + 0)
00614 #define NPRES_NETWORK_ERR  (NPRES_BASE + 1)
00615 #define NPRES_USER_BREAK   (NPRES_BASE + 2)
00616 
00617 /*
00618  * Don't use these obsolete error codes any more.
00619  */
00620 #define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
00621 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
00622 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
00623 
00624 /*
00625  * Version feature information
00626  */
00627 #define NPVERS_HAS_STREAMOUTPUT           8
00628 #define NPVERS_HAS_NOTIFICATION           9
00629 #define NPVERS_HAS_LIVECONNECT            9
00630 #define NPVERS_WIN16_HAS_LIVECONNECT      9
00631 #define NPVERS_68K_HAS_LIVECONNECT        11
00632 #define NPVERS_HAS_WINDOWLESS             11
00633 #define NPVERS_HAS_XPCONNECT_SCRIPTING    13
00634 #define NPVERS_HAS_NPRUNTIME_SCRIPTING    14
00635 #define NPVERS_HAS_FORM_VALUES            15
00636 #define NPVERS_HAS_POPUPS_ENABLED_STATE   16
00637 #define NPVERS_HAS_RESPONSE_HEADERS       17
00638 
00639 /*----------------------------------------------------------------------*/
00640 /*                        Function Prototypes                           */
00641 /*----------------------------------------------------------------------*/
00642 
00643 #if defined(_WINDOWS) && !defined(WIN32)
00644 #define NP_LOADDS  _loadds
00645 #else
00646 #if defined(__OS2__)
00647 #define NP_LOADDS _System
00648 #else
00649 #define NP_LOADDS
00650 #endif
00651 #endif
00652 
00653 #ifdef __cplusplus
00654 extern "C" {
00655 #endif
00656 
00657 /*
00658  * NPP_* functions are provided by the plugin and called by the navigator.
00659  */
00660 
00661 #ifdef XP_UNIX
00662 char* NPP_GetMIMEDescription(void);
00663 #endif /* XP_UNIX */
00664 
00665 NPError NP_LOADDS NPP_Initialize(void);
00666 void    NP_LOADDS NPP_Shutdown(void);
00667 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
00668                           uint16 mode, int16 argc, char* argn[],
00669                           char* argv[], NPSavedData* saved);
00670 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
00671 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
00672 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
00673                                 NPStream* stream, NPBool seekable,
00674                                 uint16* stype);
00675 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
00676                                     NPReason reason);
00677 int32   NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
00678 int32   NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
00679                             int32 len, void* buffer);
00680 void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00681                                    const char* fname);
00682 void    NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
00683 int16   NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
00684 void    NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
00685                                 NPReason reason, void* notifyData);
00686 #ifdef OJI
00687 jref    NP_LOADDS NPP_GetJavaClass(void);
00688 #endif
00689 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
00690 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
00691 
00692 /*
00693  * NPN_* functions are provided by the navigator and called by the plugin.
00694  */
00695 void    NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
00696                               int* netscape_major, int* netscape_minor);
00697 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
00698                                    const char* target, void* notifyData);
00699 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
00700                              const char* target);
00701 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
00702                                     const char* target, uint32 len,
00703                                     const char* buf, NPBool file,
00704                                     void* notifyData);
00705 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
00706                               const char* target, uint32 len,
00707                               const char* buf, NPBool file);
00708 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
00709 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
00710                                 const char* target, NPStream** stream);
00711 int32   NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
00712 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
00713 void    NP_LOADDS NPN_Status(NPP instance, const char* message);
00714 const char* NP_LOADDS       NPN_UserAgent(NPP instance);
00715 void*   NP_LOADDS NPN_MemAlloc(uint32 size);
00716 void    NP_LOADDS NPN_MemFree(void* ptr);
00717 uint32  NP_LOADDS NPN_MemFlush(uint32 size);
00718 void    NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
00719 #ifdef OJI
00720 JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
00721 jref    NP_LOADDS NPN_GetJavaPeer(NPP instance);
00722 #endif
00723 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
00724 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
00725 void    NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
00726 void    NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
00727 void    NP_LOADDS NPN_ForceRedraw(NPP instance);
00728 void    NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
00729 void    NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
00730 
00731 #ifdef __cplusplus
00732 }  /* end extern "C" */
00733 #endif
00734 
00735 #endif /* RC_INVOKED */
00736 #ifdef __OS2__
00737 #pragma pack()
00738 #endif
00739 
00740 #endif /* _NPAPI_H_ */