npapi.h 20 KB

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