00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef _NPAPI_H_
00046 #define _NPAPI_H_
00047
00048 #ifdef __OS2__
00049 #pragma pack(1)
00050 #endif
00051
00052 #include "prtypes.h"
00053
00054
00055 #ifndef XP_MAC
00056 #ifndef _INT16
00057 #define _INT16
00058 #endif
00059 #ifndef _INT32
00060 #define _INT32
00061 #endif
00062 #ifndef _UINT16
00063 #define _UINT16
00064 #endif
00065 #ifndef _UINT32
00066 #define _UINT32
00067 #endif
00068 #endif
00069
00070
00071
00072
00073
00074
00075
00076 #ifndef NO_NSPR_10_SUPPORT
00077 #define NO_NSPR_10_SUPPORT
00078 #endif
00079 #ifdef OJI
00080 #include "jri.h"
00081 #endif
00082
00083 #if defined (__OS2__ ) || defined (OS2)
00084 # ifndef XP_OS2
00085 # define XP_OS2 1
00086 # endif
00087 #endif
00088
00089 #ifdef _WINDOWS
00090 # include <windef.h>
00091 # ifndef XP_WIN
00092 # define XP_WIN 1
00093 # endif
00094 #endif
00095
00096 #ifdef __MWERKS__
00097 # define _declspec __declspec
00098 # ifdef macintosh
00099 # ifndef XP_MAC
00100 # define XP_MAC 1
00101 # endif
00102 # endif
00103 # ifdef __INTEL__
00104 # undef NULL
00105 # ifndef XP_WIN
00106 # define XP_WIN 1
00107 # endif
00108 # endif
00109 #endif
00110
00111 #if defined(XP_MAC) || defined(XP_MACOSX)
00112 #include <Quickdraw.h>
00113 #include <Events.h>
00114 #endif
00115
00116 #if defined(XP_UNIX)
00117 # include <stdio.h>
00118 # if defined(MOZ_X11)
00119 # include <X11/Xlib.h>
00120 # include <X11/Xutil.h>
00121 # endif
00122 #endif
00123
00124
00125
00126
00127
00128 #define NP_VERSION_MAJOR 0
00129 #define NP_VERSION_MINOR 13
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 #define NP_INFO_ProductVersion 1
00162 #define NP_INFO_MIMEType 2
00163 #define NP_INFO_FileOpenName 3
00164 #define NP_INFO_FileExtents 4
00165
00166
00167 #define NP_INFO_FileDescription 5
00168 #define NP_INFO_ProductName 6
00169
00170
00171 #define NP_INFO_CompanyName 7
00172 #define NP_INFO_FileVersion 8
00173 #define NP_INFO_InternalName 9
00174 #define NP_INFO_LegalCopyright 10
00175 #define NP_INFO_OriginalFilename 11
00176
00177 #ifndef RC_INVOKED
00178
00179
00180
00181
00182
00183
00184
00185 #ifndef _UINT16
00186 typedef unsigned short uint16;
00187 #endif
00188
00189 #ifndef _UINT32
00190 # if defined(__alpha) || defined(_AIX) || defined(__x86_64__) || defined(__LP64__) || defined(__amd64__)
00191 typedef unsigned int uint32;
00192 # else
00193 typedef unsigned long uint32;
00194 # endif
00195 #endif
00196
00197
00198
00199
00200 #ifndef AIX
00201 #ifndef _INT16
00202 typedef short int16;
00203 #endif
00204
00205 #ifndef _INT32
00206 # if defined(__alpha) || defined(_AIX) || defined(__x86_64__) || defined(__LP64__) || defined(__amd64__)
00207 typedef int int32;
00208 # else
00209 typedef long int32;
00210 # endif
00211 #endif
00212 #endif
00213
00214 #ifndef FALSE
00215 #define FALSE (0)
00216 #endif
00217 #ifndef TRUE
00218 #define TRUE (1)
00219 #endif
00220 #ifndef NULL
00221 #define NULL (0L)
00222 #endif
00223
00224 typedef unsigned char NPBool;
00225 typedef int16 NPError;
00226 typedef int16 NPReason;
00227 typedef char* NPMIMEType;
00228
00229
00230
00231
00232
00233
00234
00235 #ifdef XP_MAC
00236 #pragma options align=mac68k
00237 #endif
00238
00239
00240
00241
00242 typedef struct _NPP
00243 {
00244 void* pdata;
00245 void* ndata;
00246 } NPP_t;
00247
00248 typedef NPP_t* NPP;
00249
00250
00251 typedef struct _NPStream
00252 {
00253 void* pdata;
00254 void* ndata;
00255 const char* url;
00256 uint32 end;
00257 uint32 lastmodified;
00258 void* notifyData;
00259 } NPStream;
00260
00261
00262 typedef struct _NPByteRange
00263 {
00264 int32 offset;
00265 uint32 length;
00266 struct _NPByteRange* next;
00267 } NPByteRange;
00268
00269
00270 typedef struct _NPSavedData
00271 {
00272 int32 len;
00273 void* buf;
00274 } NPSavedData;
00275
00276
00277 typedef struct _NPRect
00278 {
00279 uint16 top;
00280 uint16 left;
00281 uint16 bottom;
00282 uint16 right;
00283 } NPRect;
00284
00285 typedef struct _NPSize
00286 {
00287 int32 width;
00288 int32 height;
00289 } NPSize;
00290
00291 #ifdef XP_UNIX
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301 enum {
00302 NP_SETWINDOW = 1,
00303 NP_PRINT
00304 };
00305
00306 typedef struct
00307 {
00308 int32 type;
00309 } NPAnyCallbackStruct;
00310
00311 typedef struct
00312 {
00313 int32 type;
00314 #ifdef MOZ_X11
00315 Display* display;
00316 Visual* visual;
00317 Colormap colormap;
00318 unsigned int depth;
00319 #endif
00320 } NPSetWindowCallbackStruct;
00321
00322 typedef struct
00323 {
00324 int32 type;
00325 FILE* fp;
00326 } NPPrintCallbackStruct;
00327
00328 #endif
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344 #define NP_ABI_GCC3_MASK 0x10000000
00345
00346
00347
00348
00349 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
00350 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
00351 #else
00352 #define _NP_ABI_MIXIN_FOR_GCC3 0
00353 #endif
00354
00355
00356 #define NP_ABI_MACHO_MASK 0x01000000
00357
00358
00359
00360
00361
00362
00363
00364 #if (defined(TARGET_RT_MAC_MACHO))
00365 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
00366 #else
00367 #define _NP_ABI_MIXIN_FOR_MACHO 0
00368 #endif
00369
00370
00371 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
00372
00373
00374
00375
00376 typedef enum {
00377 NPPVpluginNameString = 1,
00378 NPPVpluginDescriptionString,
00379 NPPVpluginWindowBool,
00380 NPPVpluginTransparentBool,
00381 NPPVjavaClass,
00382 NPPVpluginWindowSize,
00383 NPPVpluginTimerInterval,
00384
00385 NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
00386 NPPVpluginScriptableIID = 11,
00387
00388
00389 NPPVjavascriptPushCallerBool = 12,
00390 NPPVpluginKeepLibraryInMemory = 13,
00391 NPPVpluginNeedsXEmbed = 14
00392 } NPPVariable;
00393
00394
00395
00396
00397 typedef enum {
00398 NPNVxDisplay = 1,
00399 NPNVxtAppContext,
00400 NPNVnetscapeWindow,
00401 NPNVjavascriptEnabledBool,
00402 NPNVasdEnabledBool,
00403 NPNVisOfflineBool,
00404
00405
00406 NPNVserviceManager = (10 | NP_ABI_MASK),
00407 NPNVDOMElement = (11 | NP_ABI_MASK),
00408 NPNVDOMWindow = (12 | NP_ABI_MASK),
00409 NPNVToolkit = (13 | NP_ABI_MASK),
00410 NPNVSupportsXEmbedBool = 14
00411 } NPNVariable;
00412
00413
00414
00415
00416 typedef enum {
00417 NPNVGtk12 = 1,
00418 NPNVGtk2
00419 } NPNToolkitType;
00420
00421
00422
00423
00424
00425 typedef enum {
00426 NPWindowTypeWindow = 1,
00427 NPWindowTypeDrawable
00428 } NPWindowType;
00429
00430 typedef struct _NPWindow
00431 {
00432 void* window;
00433
00434
00435 int32 x;
00436 int32 y;
00437 uint32 width;
00438 uint32 height;
00439 NPRect clipRect;
00440
00441 #if defined(XP_UNIX) && !defined(XP_MACOSX)
00442 void * ws_info;
00443 #endif
00444 NPWindowType type;
00445 } NPWindow;
00446
00447
00448 typedef struct _NPFullPrint
00449 {
00450 NPBool pluginPrinted;
00451 NPBool printOne;
00452 void* platformPrint;
00453 } NPFullPrint;
00454
00455 typedef struct _NPEmbedPrint
00456 {
00457 NPWindow window;
00458 void* platformPrint;
00459 } NPEmbedPrint;
00460
00461 typedef struct _NPPrint
00462 {
00463 uint16 mode;
00464 union
00465 {
00466 NPFullPrint fullPrint;
00467 NPEmbedPrint embedPrint;
00468 } print;
00469 } NPPrint;
00470
00471 #if defined(XP_MAC) || defined(XP_MACOSX)
00472 typedef EventRecord NPEvent;
00473 #elif defined(XP_WIN)
00474 typedef struct _NPEvent
00475 {
00476 uint16 event;
00477 uint32 wParam;
00478 uint32 lParam;
00479 } NPEvent;
00480 #elif defined(XP_OS2)
00481 typedef struct _NPEvent
00482 {
00483 uint32 event;
00484 uint32 wParam;
00485 uint32 lParam;
00486 } NPEvent;
00487 #elif defined (XP_UNIX) && defined(MOZ_X11)
00488 typedef XEvent NPEvent;
00489 #else
00490 typedef void* NPEvent;
00491 #endif
00492
00493 #if defined(XP_MAC) || defined(XP_MACOSX)
00494 typedef RgnHandle NPRegion;
00495 #elif defined(XP_WIN)
00496 typedef HRGN NPRegion;
00497 #elif defined(XP_UNIX) && defined(MOZ_X11)
00498 typedef Region NPRegion;
00499 #else
00500 typedef void *NPRegion;
00501 #endif
00502
00503 #if defined(XP_MAC) || defined(XP_MACOSX)
00504
00505
00506
00507
00508 typedef struct NP_Port
00509 {
00510 CGrafPtr port;
00511 int32 portx;
00512 int32 porty;
00513 } NP_Port;
00514
00515
00516
00517
00518
00519 enum NPEventType {
00520 NPEventType_GetFocusEvent = (osEvt + 16),
00521 NPEventType_LoseFocusEvent,
00522 NPEventType_AdjustCursorEvent,
00523 NPEventType_MenuCommandEvent,
00524 NPEventType_ClippingChangedEvent,
00525 NPEventType_ScrollingBeginsEvent = 1000,
00526 NPEventType_ScrollingEndsEvent
00527 };
00528
00529 #ifdef OBSOLETE
00530 #define getFocusEvent (osEvt + 16)
00531 #define loseFocusEvent (osEvt + 17)
00532 #define adjustCursorEvent (osEvt + 18)
00533 #endif
00534 #endif
00535
00536
00537
00538
00539 #define NP_EMBED 1
00540 #define NP_FULL 2
00541
00542
00543
00544
00545 #define NP_NORMAL 1
00546 #define NP_SEEK 2
00547 #define NP_ASFILE 3
00548 #define NP_ASFILEONLY 4
00549
00550 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
00551
00552 #ifdef XP_MAC
00553 #pragma options align=reset
00554 #endif
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564 #define NPERR_BASE 0
00565 #define NPERR_NO_ERROR (NPERR_BASE + 0)
00566 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
00567 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
00568 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
00569 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
00570 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
00571 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
00572 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
00573 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
00574 #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
00575 #define NPERR_INVALID_URL (NPERR_BASE + 10)
00576 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
00577 #define NPERR_NO_DATA (NPERR_BASE + 12)
00578 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
00579
00580
00581
00582
00583 #define NPRES_BASE 0
00584 #define NPRES_DONE (NPRES_BASE + 0)
00585 #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
00586 #define NPRES_USER_BREAK (NPRES_BASE + 2)
00587
00588
00589
00590
00591 #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
00592 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
00593 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
00594
00595
00596
00597
00598 #define NPVERS_HAS_STREAMOUTPUT 8
00599 #define NPVERS_HAS_NOTIFICATION 9
00600 #define NPVERS_HAS_LIVECONNECT 9
00601 #define NPVERS_WIN16_HAS_LIVECONNECT 9
00602 #define NPVERS_68K_HAS_LIVECONNECT 11
00603 #define NPVERS_HAS_WINDOWLESS 11
00604 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
00605
00606
00607
00608
00609
00610 #if defined(_WINDOWS) && !defined(WIN32)
00611 #define NP_LOADDS _loadds
00612 #else
00613 #if defined(__OS2__)
00614 #define NP_LOADDS _System
00615 #else
00616 #define NP_LOADDS
00617 #endif
00618 #endif
00619
00620 #ifdef __cplusplus
00621 extern "C" {
00622 #endif
00623
00624
00625
00626
00627
00628 #ifdef XP_UNIX
00629 char* NPP_GetMIMEDescription(void);
00630 #endif
00631
00632 NPError NP_LOADDS NPP_Initialize(void);
00633 void NP_LOADDS NPP_Shutdown(void);
00634 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
00635 uint16 mode, int16 argc, char* argn[],
00636 char* argv[], NPSavedData* saved);
00637 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
00638 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
00639 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
00640 NPStream* stream, NPBool seekable,
00641 uint16* stype);
00642 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
00643 NPReason reason);
00644 int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
00645 int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
00646 int32 len, void* buffer);
00647 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00648 const char* fname);
00649 void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
00650 int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
00651 void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
00652 NPReason reason, void* notifyData);
00653 #ifdef OJI
00654 jref NP_LOADDS NPP_GetJavaClass(void);
00655 #endif
00656 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
00657 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
00658
00659
00660
00661
00662 void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
00663 int* netscape_major, int* netscape_minor);
00664 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
00665 const char* target, void* notifyData);
00666 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
00667 const char* target);
00668 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
00669 const char* target, uint32 len,
00670 const char* buf, NPBool file,
00671 void* notifyData);
00672 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
00673 const char* target, uint32 len,
00674 const char* buf, NPBool file);
00675 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
00676 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
00677 const char* target, NPStream** stream);
00678 int32 NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
00679 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
00680 void NP_LOADDS NPN_Status(NPP instance, const char* message);
00681 const char* NP_LOADDS NPN_UserAgent(NPP instance);
00682 void* NP_LOADDS NPN_MemAlloc(uint32 size);
00683 void NP_LOADDS NPN_MemFree(void* ptr);
00684 uint32 NP_LOADDS NPN_MemFlush(uint32 size);
00685 void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
00686 #ifdef OJI
00687 JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
00688 jref NP_LOADDS NPN_GetJavaPeer(NPP instance);
00689 #endif
00690 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
00691 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
00692 void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
00693 void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
00694 void NP_LOADDS NPN_ForceRedraw(NPP instance);
00695
00696 #ifdef __cplusplus
00697 }
00698 #endif
00699
00700 #endif
00701 #ifdef __OS2__
00702 #pragma pack()
00703 #endif
00704
00705 #endif