PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/npapi.h

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