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 #define MOZ_X11 1
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 _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
00068
00069
00070
00071
00072
00073
00074 #ifndef NO_NSPR_10_SUPPORT
00075 #define NO_NSPR_10_SUPPORT
00076 #endif
00077 #ifdef OJI
00078 #include "jri.h"
00079 #endif
00080
00081 #if defined (__OS2__ ) || defined (OS2)
00082 # ifndef XP_OS2
00083 # define XP_OS2 1
00084 # endif
00085 #endif
00086
00087 #ifdef _WINDOWS
00088 # include <windef.h>
00089 # ifndef XP_WIN
00090 # define XP_WIN 1
00091 # endif
00092 #endif
00093
00094 #ifdef __MWERKS__
00095 # define _declspec __declspec
00096 # ifdef __INTEL__
00097 # undef NULL
00098 # ifndef XP_WIN
00099 # define XP_WIN 1
00100 # endif
00101 # endif
00102 #endif
00103
00104 #ifdef XP_MACOSX
00105 #include <Carbon/Carbon.h>
00106 #ifdef __LP64__
00107 #define NP_NO_QUICKDRAW
00108 #endif
00109 #endif
00110
00111 #if defined(XP_UNIX)
00112 # include <stdio.h>
00113 # if defined(MOZ_X11)
00114 # include <X11/Xlib.h>
00115 # include <X11/Xutil.h>
00116 # endif
00117 #endif
00118
00119
00120
00121
00122
00123 #define NP_VERSION_MAJOR 0
00124 #define NP_VERSION_MINOR 19
00125
00126
00127
00128
00129
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 #define NP_INFO_ProductVersion 1
00157 #define NP_INFO_MIMEType 2
00158 #define NP_INFO_FileOpenName 3
00159 #define NP_INFO_FileExtents 4
00160
00161
00162 #define NP_INFO_FileDescription 5
00163 #define NP_INFO_ProductName 6
00164
00165
00166 #define NP_INFO_CompanyName 7
00167 #define NP_INFO_FileVersion 8
00168 #define NP_INFO_InternalName 9
00169 #define NP_INFO_LegalCopyright 10
00170 #define NP_INFO_OriginalFilename 11
00171
00172 #ifndef RC_INVOKED
00173
00174
00175
00176
00177
00178
00179
00180 #ifndef _UINT16
00181 typedef unsigned short uint16;
00182 #endif
00183
00184 #ifndef _UINT32
00185 # if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
00186 typedef unsigned int uint32;
00187 # else
00188 typedef unsigned long uint32;
00189 # endif
00190 #endif
00191
00192
00193
00194
00195 #ifndef AIX
00196 #ifndef _INT16
00197 typedef short int16;
00198 #endif
00199
00200 #ifndef _INT32
00201 # if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
00202 typedef int int32;
00203 # else
00204 typedef long int32;
00205 # endif
00206 #endif
00207 #endif
00208
00209 #ifndef FALSE
00210 #define FALSE (0)
00211 #endif
00212 #ifndef TRUE
00213 #define TRUE (1)
00214 #endif
00215 #ifndef NULL
00216 #define NULL (0L)
00217 #endif
00218
00219 #ifdef XP_MACOSX
00220 typedef enum {
00221 #ifndef NP_NO_QUICKDRAW
00222 NPDrawingModelQuickDraw = 0,
00223 #endif
00224 NPDrawingModelCoreGraphics = 1
00225 } NPDrawingModel;
00226 #endif
00227
00228 typedef unsigned char NPBool;
00229 typedef int16 NPError;
00230 typedef int16 NPReason;
00231 typedef char* NPMIMEType;
00232
00233
00234
00235
00236
00237
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 const char* headers;
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 } NPStream;
00270
00271
00272 typedef struct _NPByteRange
00273 {
00274 int32 offset;
00275 uint32 length;
00276 struct _NPByteRange* next;
00277 } NPByteRange;
00278
00279
00280 typedef struct _NPSavedData
00281 {
00282 int32 len;
00283 void* buf;
00284 } NPSavedData;
00285
00286
00287 typedef struct _NPRect
00288 {
00289 uint16 top;
00290 uint16 left;
00291 uint16 bottom;
00292 uint16 right;
00293 } NPRect;
00294
00295 typedef struct _NPSize
00296 {
00297 int32 width;
00298 int32 height;
00299 } NPSize;
00300
00301 #ifdef XP_UNIX
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311 enum {
00312 NP_SETWINDOW = 1,
00313 NP_PRINT
00314 };
00315
00316 typedef struct
00317 {
00318 int32 type;
00319 } NPAnyCallbackStruct;
00320
00321 typedef struct
00322 {
00323 int32 type;
00324 #ifdef MOZ_X11
00325 Display* display;
00326 Visual* visual;
00327 Colormap colormap;
00328 unsigned int depth;
00329 #endif
00330 } NPSetWindowCallbackStruct;
00331
00332 typedef struct
00333 {
00334 int32 type;
00335 FILE* fp;
00336 } NPPrintCallbackStruct;
00337
00338 #endif
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354 #define NP_ABI_GCC3_MASK 0x10000000
00355
00356
00357
00358
00359 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
00360 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
00361 #else
00362 #define _NP_ABI_MIXIN_FOR_GCC3 0
00363 #endif
00364
00365
00366 #define NP_ABI_MACHO_MASK 0x01000000
00367
00368
00369
00370
00371
00372
00373
00374 #if (defined(TARGET_RT_MAC_MACHO))
00375 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
00376 #else
00377 #define _NP_ABI_MIXIN_FOR_MACHO 0
00378 #endif
00379
00380
00381 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
00382
00383
00384
00385
00386 typedef enum {
00387 NPPVpluginNameString = 1,
00388 NPPVpluginDescriptionString,
00389 NPPVpluginWindowBool,
00390 NPPVpluginTransparentBool,
00391 NPPVjavaClass,
00392 NPPVpluginWindowSize,
00393 NPPVpluginTimerInterval,
00394
00395 NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
00396 NPPVpluginScriptableIID = 11,
00397
00398
00399 NPPVjavascriptPushCallerBool = 12,
00400
00401
00402 NPPVpluginKeepLibraryInMemory = 13,
00403 NPPVpluginNeedsXEmbed = 14,
00404
00405
00406
00407
00408 NPPVpluginScriptableNPObject = 15,
00409
00410
00411
00412
00413
00414
00415 NPPVformValue = 16
00416 #ifdef XP_MACOSX
00417
00418 , NPPVpluginDrawingModel = 1000
00419 #endif
00420 } NPPVariable;
00421
00422
00423
00424
00425 typedef enum {
00426 NPNVxDisplay = 1,
00427 NPNVxtAppContext,
00428 NPNVnetscapeWindow,
00429 NPNVjavascriptEnabledBool,
00430 NPNVasdEnabledBool,
00431 NPNVisOfflineBool,
00432
00433
00434 NPNVserviceManager = (10 | NP_ABI_MASK),
00435 NPNVDOMElement = (11 | NP_ABI_MASK),
00436 NPNVDOMWindow = (12 | NP_ABI_MASK),
00437 NPNVToolkit = (13 | NP_ABI_MASK),
00438 NPNVSupportsXEmbedBool = 14,
00439
00440
00441 NPNVWindowNPObject = 15,
00442
00443
00444 NPNVPluginElementNPObject = 16,
00445
00446 NPNVSupportsWindowless = 17
00447
00448 #ifdef XP_MACOSX
00449
00450 , NPNVpluginDrawingModel = 1000
00451 #ifndef NP_NO_QUICKDRAW
00452 , NPNVsupportsQuickDrawBool = 2000
00453 #endif
00454 , NPNVsupportsCoreGraphicsBool = 2001
00455 #endif
00456 } NPNVariable;
00457
00458
00459
00460
00461 typedef enum {
00462 NPNVGtk12 = 1,
00463 NPNVGtk2
00464 } NPNToolkitType;
00465
00466
00467
00468
00469
00470 typedef enum {
00471 NPWindowTypeWindow = 1,
00472 NPWindowTypeDrawable
00473 } NPWindowType;
00474
00475 typedef struct _NPWindow
00476 {
00477 void* window;
00478
00479
00480 int32 x;
00481 int32 y;
00482 uint32 width;
00483 uint32 height;
00484 NPRect clipRect;
00485
00486 #if defined(XP_UNIX) && !defined(XP_MACOSX)
00487 void * ws_info;
00488 #endif
00489 NPWindowType type;
00490 } NPWindow;
00491
00492
00493 typedef struct _NPFullPrint
00494 {
00495 NPBool pluginPrinted;
00496 NPBool printOne;
00497 void* platformPrint;
00498 } NPFullPrint;
00499
00500 typedef struct _NPEmbedPrint
00501 {
00502 NPWindow window;
00503 void* platformPrint;
00504 } NPEmbedPrint;
00505
00506 typedef struct _NPPrint
00507 {
00508 uint16 mode;
00509 union
00510 {
00511 NPFullPrint fullPrint;
00512 NPEmbedPrint embedPrint;
00513 } print;
00514 } NPPrint;
00515
00516 #ifdef XP_MACOSX
00517 typedef EventRecord NPEvent;
00518 #elif defined(XP_WIN)
00519 typedef struct _NPEvent
00520 {
00521 uint16 event;
00522 uint32 wParam;
00523 uint32 lParam;
00524 } NPEvent;
00525 #elif defined(XP_OS2)
00526 typedef struct _NPEvent
00527 {
00528 uint32 event;
00529 uint32 wParam;
00530 uint32 lParam;
00531 } NPEvent;
00532 #elif defined (XP_UNIX) && defined(MOZ_X11)
00533 typedef XEvent NPEvent;
00534 #else
00535 typedef void* NPEvent;
00536 #endif
00537
00538 #ifdef XP_MACOSX
00539 typedef void* NPRegion;
00540 #ifndef NP_NO_QUICKDRAW
00541 typedef RgnHandle NPQDRegion;
00542 #endif
00543 typedef CGPathRef NPCGRegion;
00544 #elif defined(XP_WIN)
00545 typedef HRGN NPRegion;
00546 #elif defined(XP_UNIX) && defined(MOZ_X11)
00547 typedef Region NPRegion;
00548 #else
00549 typedef void *NPRegion;
00550 #endif
00551
00552 #ifdef XP_MACOSX
00553
00554
00555
00556
00557 typedef struct NP_Port
00558 {
00559 CGrafPtr port;
00560 int32 portx;
00561 int32 porty;
00562 } NP_Port;
00563
00564 typedef struct NP_CGContext
00565 {
00566 CGContextRef context;
00567 WindowRef window;
00568 } NP_CGContext;
00569
00570
00571
00572
00573
00574 enum NPEventType {
00575 NPEventType_GetFocusEvent = (osEvt + 16),
00576 NPEventType_LoseFocusEvent,
00577 NPEventType_AdjustCursorEvent,
00578 NPEventType_MenuCommandEvent,
00579 NPEventType_ClippingChangedEvent,
00580 NPEventType_ScrollingBeginsEvent = 1000,
00581 NPEventType_ScrollingEndsEvent
00582 };
00583
00584 #ifdef OBSOLETE
00585 #define getFocusEvent (osEvt + 16)
00586 #define loseFocusEvent (osEvt + 17)
00587 #define adjustCursorEvent (osEvt + 18)
00588 #endif
00589 #endif
00590
00591
00592
00593
00594 #define NP_EMBED 1
00595 #define NP_FULL 2
00596
00597
00598
00599
00600 #define NP_NORMAL 1
00601 #define NP_SEEK 2
00602 #define NP_ASFILE 3
00603 #define NP_ASFILEONLY 4
00604
00605 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615 #define NPERR_BASE 0
00616 #define NPERR_NO_ERROR (NPERR_BASE + 0)
00617 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
00618 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
00619 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
00620 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
00621 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
00622 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
00623 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
00624 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
00625 #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
00626 #define NPERR_INVALID_URL (NPERR_BASE + 10)
00627 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
00628 #define NPERR_NO_DATA (NPERR_BASE + 12)
00629 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
00630
00631
00632
00633
00634 #define NPRES_BASE 0
00635 #define NPRES_DONE (NPRES_BASE + 0)
00636 #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
00637 #define NPRES_USER_BREAK (NPRES_BASE + 2)
00638
00639
00640
00641
00642 #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
00643 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
00644 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
00645
00646
00647
00648
00649 #define NPVERS_HAS_STREAMOUTPUT 8
00650 #define NPVERS_HAS_NOTIFICATION 9
00651 #define NPVERS_HAS_LIVECONNECT 9
00652 #define NPVERS_WIN16_HAS_LIVECONNECT 9
00653 #define NPVERS_68K_HAS_LIVECONNECT 11
00654 #define NPVERS_HAS_WINDOWLESS 11
00655 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
00656 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
00657 #define NPVERS_HAS_FORM_VALUES 15
00658 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16
00659 #define NPVERS_HAS_RESPONSE_HEADERS 17
00660 #define NPVERS_HAS_NPOBJECT_ENUM 18
00661 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
00662
00663
00664
00665
00666
00667 #if defined(_WINDOWS) && !defined(WIN32)
00668 #define NP_LOADDS _loadds
00669 #else
00670 #if defined(__OS2__)
00671 #define NP_LOADDS _System
00672 #else
00673 #define NP_LOADDS
00674 #endif
00675 #endif
00676
00677 #ifdef __cplusplus
00678 extern "C" {
00679 #endif
00680
00681
00682
00683
00684
00685 #ifdef XP_UNIX
00686 char* NPP_GetMIMEDescription(void);
00687 #endif
00688
00689 NPError NP_LOADDS NPP_Initialize(void);
00690 void NP_LOADDS NPP_Shutdown(void);
00691 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
00692 uint16 mode, int16 argc, char* argn[],
00693 char* argv[], NPSavedData* saved);
00694 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
00695 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
00696 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
00697 NPStream* stream, NPBool seekable,
00698 uint16* stype);
00699 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
00700 NPReason reason);
00701 int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
00702 int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
00703 int32 len, void* buffer);
00704 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00705 const char* fname);
00706 void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
00707 int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
00708 void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
00709 NPReason reason, void* notifyData);
00710 #ifdef OJI
00711 jref NP_LOADDS NPP_GetJavaClass(void);
00712 #endif
00713 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
00714 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
00715
00716
00717
00718
00719 void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
00720 int* netscape_major, int* netscape_minor);
00721 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
00722 const char* target, void* notifyData);
00723 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
00724 const char* target);
00725 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
00726 const char* target, uint32 len,
00727 const char* buf, NPBool file,
00728 void* notifyData);
00729 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
00730 const char* target, uint32 len,
00731 const char* buf, NPBool file);
00732 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
00733 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
00734 const char* target, NPStream** stream);
00735 int32 NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
00736 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
00737 void NP_LOADDS NPN_Status(NPP instance, const char* message);
00738 const char* NP_LOADDS NPN_UserAgent(NPP instance);
00739 void* NP_LOADDS NPN_MemAlloc(uint32 size);
00740 void NP_LOADDS NPN_MemFree(void* ptr);
00741 uint32 NP_LOADDS NPN_MemFlush(uint32 size);
00742 void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
00743 #ifdef OJI
00744 JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
00745 jref NP_LOADDS NPN_GetJavaPeer(NPP instance);
00746 #endif
00747 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
00748 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
00749 void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
00750 void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
00751 void NP_LOADDS NPN_ForceRedraw(NPP instance);
00752 void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
00753 void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
00754 void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
00755 void (*func) (void *),
00756 void *userData);
00757
00758 #ifdef __cplusplus
00759 }
00760 #endif
00761
00762 #endif
00763 #ifdef __OS2__
00764 #pragma pack()
00765 #endif
00766
00767 #endif