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