Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
npapi.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 
6 #ifndef npapi_h_
7 #define npapi_h_
8 
9 #if defined(__OS2__)
10 #pragma pack(1)
11 #endif
12 
13 #include "nptypes.h"
14 
15 #if defined(__OS2__) || defined(OS2)
16 #ifndef XP_OS2
17 #define XP_OS2 1
18 #endif
19 #endif
20 
21 #if defined(_WIN32) && !defined(__SYMBIAN32__)
22 #include <windef.h>
23 #ifndef XP_WIN
24 #define XP_WIN 1
25 #endif
26 #endif
27 
28 #if defined(__SYMBIAN32__)
29 #ifndef XP_SYMBIAN
30 #define XP_SYMBIAN 1
31 #undef XP_WIN
32 #endif
33 #endif
34 
35 #if defined(__APPLE_CC__) && !defined(XP_UNIX)
36 #ifndef XP_MACOSX
37 #define XP_MACOSX 1
38 #endif
39 #endif
40 
41 #if defined(XP_MACOSX) && defined(__LP64__)
42 #define NP_NO_QUICKDRAW
43 #define NP_NO_CARBON
44 #endif
45 
46 #if defined(XP_MACOSX)
47 #include <ApplicationServices/ApplicationServices.h>
48 #include <OpenGL/OpenGL.h>
49 #ifndef NP_NO_CARBON
50 #include <Carbon/Carbon.h>
51 #endif
52 #endif
53 
54 #if defined(XP_UNIX)
55 #include <stdio.h>
56 #if defined(MOZ_X11)
57 #include <X11/Xlib.h>
58 #include <X11/Xutil.h>
59 #endif
60 #endif
61 
62 #if defined(XP_SYMBIAN)
63 #include <QEvent>
64 #include <QRegion>
65 #endif
66 
67 /*----------------------------------------------------------------------*/
68 /* Plugin Version Constants */
69 /*----------------------------------------------------------------------*/
70 
71 #define NP_VERSION_MAJOR 0
72 #define NP_VERSION_MINOR 27
73 
74 
75 /* The OS/2 version of Netscape uses RC_DATA to define the
76  mime types, file extensions, etc that are required.
77  Use a vertical bar to separate types, end types with \0.
78  FileVersion and ProductVersion are 32bit ints, all other
79  entries are strings that MUST be terminated with a \0.
80 
81 AN EXAMPLE:
82 
83 RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
84 
85 RCDATA NP_INFO_MIMEType { "video/x-video|",
86  "video/x-flick\0" }
87 RCDATA NP_INFO_FileExtents { "avi|",
88  "flc\0" }
89 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
90  "MMOS2 Flc/Fli player(*.flc)\0" }
91 
92 RCDATA NP_INFO_FileVersion { 1,0,0,1 }
93 RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
94 RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
95 RCDATA NP_INFO_InternalName { "NPAVI32\0" )
96 RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
97 RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
98 RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
99 */
100 /* RC_DATA types for version info - required */
101 #define NP_INFO_ProductVersion 1
102 #define NP_INFO_MIMEType 2
103 #define NP_INFO_FileOpenName 3
104 #define NP_INFO_FileExtents 4
105 /* RC_DATA types for version info - used if found */
106 #define NP_INFO_FileDescription 5
107 #define NP_INFO_ProductName 6
108 /* RC_DATA types for version info - optional */
109 #define NP_INFO_CompanyName 7
110 #define NP_INFO_FileVersion 8
111 #define NP_INFO_InternalName 9
112 #define NP_INFO_LegalCopyright 10
113 #define NP_INFO_OriginalFilename 11
114 
115 #ifndef RC_INVOKED
116 
117 /*----------------------------------------------------------------------*/
118 /* Definition of Basic Types */
119 /*----------------------------------------------------------------------*/
120 
121 typedef unsigned char NPBool;
122 typedef int16_t NPError;
123 typedef int16_t NPReason;
124 typedef char* NPMIMEType;
125 
126 /*----------------------------------------------------------------------*/
127 /* Structures and definitions */
128 /*----------------------------------------------------------------------*/
129 
130 #if !defined(__LP64__)
131 #if defined(XP_MACOSX)
132 #pragma options align=mac68k
133 #endif
134 #endif /* __LP64__ */
135 
136 /*
137  * NPP is a plug-in's opaque instance handle
138  */
139 typedef struct _NPP
140 {
141  void* pdata; /* plug-in private data */
142  void* ndata; /* netscape private data */
143 } NPP_t;
144 
145 typedef NPP_t* NPP;
146 
147 typedef struct _NPStream
148 {
149  void* pdata; /* plug-in private data */
150  void* ndata; /* netscape private data */
151  const char* url;
152  uint32_t end;
153  uint32_t lastmodified;
154  void* notifyData;
155  const char* headers; /* Response headers from host.
156  * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
157  * Used for HTTP only; NULL for non-HTTP.
158  * Available from NPP_NewStream onwards.
159  * Plugin should copy this data before storing it.
160  * Includes HTTP status line and all headers,
161  * preferably verbatim as received from server,
162  * headers formatted as in HTTP ("Header: Value"),
163  * and newlines (\n, NOT \r\n) separating lines.
164  * Terminated by \n\0 (NOT \n\n\0). */
165 } NPStream;
166 
167 typedef struct _NPByteRange
168 {
169  int32_t offset; /* negative offset means from the end */
170  uint32_t length;
172 } NPByteRange;
173 
174 typedef struct _NPSavedData
175 {
176  int32_t len;
177  void* buf;
178 } NPSavedData;
179 
180 typedef struct _NPRect
181 {
182  uint16_t top;
183  uint16_t left;
184  uint16_t bottom;
185  uint16_t right;
186 } NPRect;
187 
188 typedef struct _NPSize
189 {
190  int32_t width;
191  int32_t height;
192 } NPSize;
193 
194 typedef enum {
198 
199 /* These formats describe the format in the memory byte-order. This means if
200  * a 32-bit value of a pixel is viewed on a little-endian system the layout will
201  * be 0xAARRGGBB. The Alpha channel will be stored in the most significant
202  * bits. */
203 typedef enum {
204  /* 32-bit per pixel 8-bit per channel - premultiplied alpha */
206  /* 32-bit per pixel 8-bit per channel - 1 unused channel */
208 } NPImageFormat;
209 
210 typedef struct _NPAsyncSurface
211 {
212  uint32_t version;
215  union {
216  struct {
217  uint32_t stride;
218  void *data;
219  } bitmap;
220 #if defined(XP_WIN)
221  HANDLE sharedHandle;
222 #endif
223  };
225 
226 /* Return values for NPP_HandleEvent */
227 #define kNPEventNotHandled 0
228 #define kNPEventHandled 1
229 /* Exact meaning must be spec'd in event model. */
230 #define kNPEventStartIME 2
231 
232 #if defined(XP_UNIX)
233 /*
234  * Unix specific structures and definitions
235  */
236 
237 /*
238  * Callback Structures.
239  *
240  * These are used to pass additional platform specific information.
241  */
242 enum {
243  NP_SETWINDOW = 1,
244  NP_PRINT
245 };
246 
247 typedef struct
248 {
249  int32_t type;
250 } NPAnyCallbackStruct;
251 
252 typedef struct
253 {
254  int32_t type;
255 #if defined(MOZ_X11)
256  Display* display;
257  Visual* visual;
258  Colormap colormap;
259  unsigned int depth;
260 #endif
261 } NPSetWindowCallbackStruct;
262 
263 typedef struct
264 {
265  int32_t type;
266  FILE* fp;
267 } NPPrintCallbackStruct;
268 
269 #endif /* XP_UNIX */
270 
271 typedef enum {
272 #if defined(XP_MACOSX)
273 #ifndef NP_NO_QUICKDRAW
274  NPDrawingModelQuickDraw = 0,
275 #endif
276  NPDrawingModelCoreGraphics = 1,
277  NPDrawingModelOpenGL = 2,
278  NPDrawingModelCoreAnimation = 3,
279  NPDrawingModelInvalidatingCoreAnimation = 4,
280 #endif
281 #if defined(XP_WIN)
282  NPDrawingModelSyncWin = 5,
283 #endif
284 #if defined(MOZ_X11)
285  NPDrawingModelSyncX = 6,
286 #endif
288 #if defined(XP_WIN)
289  , NPDrawingModelAsyncWindowsDXGISurface = 8
290 #endif
292 
293 #ifdef XP_MACOSX
294 typedef enum {
295 #ifndef NP_NO_CARBON
296  NPEventModelCarbon = 0,
297 #endif
298  NPEventModelCocoa = 1
299 } NPEventModel;
300 #endif
301 
302 /*
303  * The following masks are applied on certain platforms to NPNV and
304  * NPPV selectors that pass around pointers to COM interfaces. Newer
305  * compilers on some platforms may generate vtables that are not
306  * compatible with older compilers. To prevent older plugins from
307  * not understanding a new browser's ABI, these masks change the
308  * values of those selectors on those platforms. To remain backwards
309  * compatible with different versions of the browser, plugins can
310  * use these masks to dynamically determine and use the correct C++
311  * ABI that the browser is expecting. This does not apply to Windows
312  * as Microsoft's COM ABI will likely not change.
313  */
314 
315 #define NP_ABI_GCC3_MASK 0x10000000
316 /*
317  * gcc 3.x generated vtables on UNIX and OSX are incompatible with
318  * previous compilers.
319  */
320 #if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
321 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
322 #else
323 #define _NP_ABI_MIXIN_FOR_GCC3 0
324 #endif
325 
326 #if defined(XP_MACOSX)
327 #define NP_ABI_MACHO_MASK 0x01000000
328 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
329 #else
330 #define _NP_ABI_MIXIN_FOR_MACHO 0
331 #endif
332 
333 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
334 
335 /*
336  * List of variable names for which NPP_GetValue shall be implemented
337  */
338 typedef enum {
351 
352  /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
353  */
355 
356  /* Get the plugin value (as \0-terminated UTF-8 string data) for
357  * form submission if the plugin is part of a form. Use
358  * NPN_MemAlloc() to allocate memory for the string data. Introduced
359  * in NPAPI minor version 15.
360  */
362 
364 
365  /* Checks if the plugin is interested in receiving the http body of
366  * all http requests (including failed ones, http status != 200).
367  */
369 
370  /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
372 
373  /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
375 
377 
379 
380  /* Used for negotiating drawing models */
382 #if defined(XP_MACOSX)
383  /* Used for negotiating event models */
384  , NPPVpluginEventModel = 1001
385  /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
386  , NPPVpluginCoreAnimationLayer = 1003
387 #endif
388 
389 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
390  , NPPVpluginWindowlessLocalBool = 2002
391 #endif
392 } NPPVariable;
393 
394 /*
395  * List of variable names for which NPN_GetValue should be implemented.
396  */
397 typedef enum {
404 
410 
411  /* Get the NPObject wrapper for the browser window. */
413 
414  /* Get the NPObject wrapper for the plugins DOM element. */
416 
418 
420 
422 
424 
425  NPNVpluginDrawingModel = 1000 /* Get the current drawing model (NPDrawingModel) */
426 #if defined(XP_MACOSX)
427  , NPNVcontentsScaleFactor = 1001
428 #ifndef NP_NO_QUICKDRAW
429  , NPNVsupportsQuickDrawBool = 2000
430 #endif
431  , NPNVsupportsCoreGraphicsBool = 2001
432  , NPNVsupportsOpenGLBool = 2002
433  , NPNVsupportsCoreAnimationBool = 2003
434  , NPNVsupportsInvalidatingCoreAnimationBool = 2004
435 #endif
437 #if defined(XP_WIN)
438  , NPNVsupportsAsyncWindowsDXGISurfaceBool = 2008
439 #endif
440 #if defined(XP_MACOSX)
441 #ifndef NP_NO_CARBON
442  , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
443 #endif
444  , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
445  , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
446  Cocoa text input specification. */
447  , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
448  CA model compositing */
449 #endif
450 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
451  , NPNVSupportsWindowlessLocal = 2002
452 #endif
453 } NPNVariable;
454 
455 typedef enum {
459 
460 /*
461  * The type of Toolkit the widgets use
462  */
463 typedef enum {
467 
468 /*
469  * The type of a NPWindow - it specifies the type of the data structure
470  * returned in the window field.
471  */
472 typedef enum {
475 } NPWindowType;
476 
477 typedef struct _NPWindow
478 {
479  void* window; /* Platform specific window handle */
480  /* OS/2: x - Position of bottom left corner */
481  /* OS/2: y - relative to visible netscape window */
482  int32_t x; /* Position of top left corner relative */
483  int32_t y; /* to a netscape page. */
484  uint32_t width; /* Maximum window size */
485  uint32_t height;
486  NPRect clipRect; /* Clipping rectangle in port coordinates */
487 #if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
488  void * ws_info; /* Platform-dependent additional data */
489 #endif /* XP_UNIX */
490  NPWindowType type; /* Is this a window or a drawable? */
491 } NPWindow;
492 
493 typedef struct _NPImageExpose
494 {
495  char* data; /* image pointer */
496  int32_t stride; /* Stride of data image pointer */
497  int32_t depth; /* Depth of image pointer */
498  int32_t x; /* Expose x */
499  int32_t y; /* Expose y */
500  uint32_t width; /* Expose width */
501  uint32_t height; /* Expose height */
502  NPSize dataSize; /* Data buffer size */
503  float translateX; /* translate X matrix value */
504  float translateY; /* translate Y matrix value */
505  float scaleX; /* scale X matrix value */
506  float scaleY; /* scale Y matrix value */
507 } NPImageExpose;
508 
509 typedef struct _NPFullPrint
510 {
511  NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
512  NPBool printOne; /* TRUE if plugin should print one copy to default
513  printer */
514  void* platformPrint; /* Platform-specific printing info */
515 } NPFullPrint;
516 
517 typedef struct _NPEmbedPrint
518 {
520  void* platformPrint; /* Platform-specific printing info */
521 } NPEmbedPrint;
522 
523 typedef struct _NPPrint
524 {
525  uint16_t mode; /* NP_FULL or NP_EMBED */
526  union
527  {
528  NPFullPrint fullPrint; /* if mode is NP_FULL */
529  NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
530  } print;
531 } NPPrint;
532 
533 #if defined(XP_MACOSX)
534 #ifndef NP_NO_CARBON
535 typedef EventRecord NPEvent;
536 #endif
537 #elif defined(XP_SYMBIAN)
538 typedef QEvent NPEvent;
539 #elif defined(XP_WIN)
540 typedef struct _NPEvent
541 {
542  uint16_t event;
543  uintptr_t wParam;
544  uintptr_t lParam;
545 } NPEvent;
546 #elif defined(XP_OS2)
547 typedef struct _NPEvent
548 {
549  uint32_t event;
550  uint32_t wParam;
551  uint32_t lParam;
552 } NPEvent;
553 #elif defined(XP_UNIX) && defined(MOZ_X11)
554 typedef XEvent NPEvent;
555 #else
556 typedef void* NPEvent;
557 #endif
558 
559 #if defined(XP_MACOSX)
560 typedef void* NPRegion;
561 #ifndef NP_NO_QUICKDRAW
562 typedef RgnHandle NPQDRegion;
563 #endif
564 typedef CGPathRef NPCGRegion;
565 #elif defined(XP_WIN)
566 typedef HRGN NPRegion;
567 #elif defined(XP_UNIX) && defined(MOZ_X11)
568 typedef Region NPRegion;
569 #elif defined(XP_SYMBIAN)
570 typedef QRegion* NPRegion;
571 #else
572 typedef void *NPRegion;
573 #endif
574 
575 typedef struct _NPNSString NPNSString;
576 typedef struct _NPNSWindow NPNSWindow;
577 typedef struct _NPNSMenu NPNSMenu;
578 
579 #if defined(XP_MACOSX)
580 typedef NPNSMenu NPMenu;
581 #else
582 typedef void *NPMenu;
583 #endif
584 
585 typedef enum {
592 
593 #if defined(XP_MACOSX)
594 
595 #ifndef NP_NO_QUICKDRAW
596 typedef struct NP_Port
597 {
598  CGrafPtr port;
599  int32_t portx; /* position inside the topmost window */
600  int32_t porty;
601 } NP_Port;
602 #endif /* NP_NO_QUICKDRAW */
603 
604 /*
605  * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
606  * as its drawing model.
607  */
608 
609 typedef struct NP_CGContext
610 {
611  CGContextRef context;
612  void *window; /* A WindowRef under the Carbon event model. */
613 } NP_CGContext;
614 
615 /*
616  * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
617  * drawing model.
618  */
619 
620 typedef struct NP_GLContext
621 {
622  CGLContextObj context;
623 #ifdef NP_NO_CARBON
625 #else
626  void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
627 #endif
628 } NP_GLContext;
629 
630 typedef enum {
631  NPCocoaEventDrawRect = 1,
632  NPCocoaEventMouseDown,
633  NPCocoaEventMouseUp,
634  NPCocoaEventMouseMoved,
635  NPCocoaEventMouseEntered,
636  NPCocoaEventMouseExited,
637  NPCocoaEventMouseDragged,
638  NPCocoaEventKeyDown,
639  NPCocoaEventKeyUp,
640  NPCocoaEventFlagsChanged,
641  NPCocoaEventFocusChanged,
642  NPCocoaEventWindowFocusChanged,
643  NPCocoaEventScrollWheel,
644  NPCocoaEventTextInput
645 } NPCocoaEventType;
646 
647 typedef struct _NPCocoaEvent {
648  NPCocoaEventType type;
649  uint32_t version;
650  union {
651  struct {
652  uint32_t modifierFlags;
653  double pluginX;
654  double pluginY;
655  int32_t buttonNumber;
656  int32_t clickCount;
657  double deltaX;
658  double deltaY;
659  double deltaZ;
660  } mouse;
661  struct {
662  uint32_t modifierFlags;
663  NPNSString *characters;
664  NPNSString *charactersIgnoringModifiers;
665  NPBool isARepeat;
666  uint16_t keyCode;
667  } key;
668  struct {
669  CGContextRef context;
670  double x;
671  double y;
672  double width;
673  double height;
674  } draw;
675  struct {
676  NPBool hasFocus;
677  } focus;
678  struct {
679  NPNSString *text;
680  } text;
681  } data;
682 } NPCocoaEvent;
683 
684 #ifndef NP_NO_CARBON
685 /* Non-standard event types that can be passed to HandleEvent */
686 enum NPEventType {
687  NPEventType_GetFocusEvent = (osEvt + 16),
688  NPEventType_LoseFocusEvent,
689  NPEventType_AdjustCursorEvent,
690  NPEventType_MenuCommandEvent,
691  NPEventType_ClippingChangedEvent,
692  NPEventType_ScrollingBeginsEvent = 1000,
693  NPEventType_ScrollingEndsEvent
694 };
695 #endif /* NP_NO_CARBON */
696 
697 #endif /* XP_MACOSX */
698 
699 /*
700  * Values for mode passed to NPP_New:
701  */
702 #define NP_EMBED 1
703 #define NP_FULL 2
704 
705 /*
706  * Values for stream type passed to NPP_NewStream:
707  */
708 #define NP_NORMAL 1
709 #define NP_SEEK 2
710 #define NP_ASFILE 3
711 #define NP_ASFILEONLY 4
712 
713 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
714 
715 /*
716  * Flags for NPP_ClearSiteData.
717  */
718 #define NP_CLEAR_ALL 0
719 #define NP_CLEAR_CACHE (1 << 0)
720 
721 #if !defined(__LP64__)
722 #if defined(XP_MACOSX)
723 #pragma options align=reset
724 #endif
725 #endif /* __LP64__ */
726 
727 /*----------------------------------------------------------------------*/
728 /* Error and Reason Code definitions */
729 /*----------------------------------------------------------------------*/
730 
731 /*
732  * Values of type NPError:
733  */
734 #define NPERR_BASE 0
735 #define NPERR_NO_ERROR (NPERR_BASE + 0)
736 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
737 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
738 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
739 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
740 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
741 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
742 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
743 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
744 #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
745 #define NPERR_INVALID_URL (NPERR_BASE + 10)
746 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
747 #define NPERR_NO_DATA (NPERR_BASE + 12)
748 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
749 #define NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)
750 #define NPERR_MALFORMED_SITE (NPERR_BASE + 15)
751 
752 /*
753  * Values of type NPReason:
754  */
755 #define NPRES_BASE 0
756 #define NPRES_DONE (NPRES_BASE + 0)
757 #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
758 #define NPRES_USER_BREAK (NPRES_BASE + 2)
759 
760 /*
761  * Don't use these obsolete error codes any more.
762  */
763 #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
764 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
765 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
766 
767 /*
768  * Version feature information
769  */
770 #define NPVERS_HAS_STREAMOUTPUT 8
771 #define NPVERS_HAS_NOTIFICATION 9
772 #define NPVERS_HAS_LIVECONNECT 9
773 #define NPVERS_68K_HAS_LIVECONNECT 11
774 #define NPVERS_HAS_WINDOWLESS 11
775 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
776 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
777 #define NPVERS_HAS_FORM_VALUES 15
778 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16
779 #define NPVERS_HAS_RESPONSE_HEADERS 17
780 #define NPVERS_HAS_NPOBJECT_ENUM 18
781 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
782 #define NPVERS_HAS_ALL_NETWORK_STREAMS 20
783 #define NPVERS_HAS_URL_AND_AUTH_INFO 21
784 #define NPVERS_HAS_PRIVATE_MODE 22
785 #define NPVERS_MACOSX_HAS_COCOA_EVENTS 23
786 #define NPVERS_HAS_ADVANCED_KEY_HANDLING 25
787 #define NPVERS_HAS_URL_REDIRECT_HANDLING 26
788 #define NPVERS_HAS_CLEAR_SITE_DATA 27
789 
790 /*----------------------------------------------------------------------*/
791 /* Function Prototypes */
792 /*----------------------------------------------------------------------*/
793 
794 #if defined(__OS2__)
795 #define NP_LOADDS _System
796 #else
797 #define NP_LOADDS
798 #endif
799 
800 #ifdef __cplusplus
801 extern "C" {
802 #endif
803 
804 /* NPP_* functions are provided by the plugin and called by the navigator. */
805 
806 #if defined(XP_UNIX)
807 const char* NPP_GetMIMEDescription(void);
808 #endif
809 
810 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
811  uint16_t mode, int16_t argc, char* argn[],
812  char* argv[], NPSavedData* saved);
813 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
816  NPStream* stream, NPBool seekable,
817  uint16_t* stype);
819  NPReason reason);
820 int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
821 int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
822  int32_t len, void* buffer);
823 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
824  const char* fname);
825 void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
826 int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
827 void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
828  NPReason reason, void* notifyData);
829 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
830 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
831 NPBool NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
832 void NP_LOADDS NPP_LostFocus(NPP instance);
833 void NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);
834 NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge);
835 char** NP_LOADDS NPP_GetSitesWithData(void);
836 void NP_LOADDS NPP_DidComposite(NPP instance);
837 
838 /* NPN_* functions are provided by the navigator and called by the plugin. */
839 void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
840  int* netscape_major, int* netscape_minor);
841 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
842  const char* target, void* notifyData);
843 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
844  const char* target);
845 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
846  const char* target, uint32_t len,
847  const char* buf, NPBool file,
848  void* notifyData);
849 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
850  const char* target, uint32_t len,
851  const char* buf, NPBool file);
854  const char* target, NPStream** stream);
855 int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
856  void* buffer);
858  NPReason reason);
859 void NP_LOADDS NPN_Status(NPP instance, const char* message);
860 const char* NP_LOADDS NPN_UserAgent(NPP instance);
861 void* NP_LOADDS NPN_MemAlloc(uint32_t size);
862 void NP_LOADDS NPN_MemFree(void* ptr);
863 uint32_t NP_LOADDS NPN_MemFlush(uint32_t size);
864 void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
865 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
866  void *value);
867 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
868  void *value);
869 void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
870 void NP_LOADDS NPN_InvalidateRegion(NPP instance,
871  NPRegion invalidRegion);
872 void NP_LOADDS NPN_ForceRedraw(NPP instance);
873 void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
876  void (*func) (void *),
877  void *userData);
879  const char *url, char **value,
880  uint32_t *len);
882  const char *url, const char *value,
883  uint32_t len);
885  const char *protocol,
886  const char *host, int32_t port,
887  const char *scheme,
888  const char *realm,
889  char **username, uint32_t *ulen,
890  char **password,
891  uint32_t *plen);
892 uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
893 void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
894 NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
895 NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
896 NPBool NP_LOADDS NPN_HandleEvent(NPP instance, void *event, NPBool handled);
898 void NP_LOADDS NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);
900  NPImageFormat format, void *initData,
901  NPAsyncSurface *surface);
903 void NP_LOADDS NPN_SetCurrentAsyncSurface(NPP instance, NPAsyncSurface *surface, NPRect *changed);
904 
905 #ifdef __cplusplus
906 } /* end extern "C" */
907 #endif
908 
909 #endif /* RC_INVOKED */
910 #if defined(__OS2__)
911 #pragma pack()
912 #endif
913 
914 #endif /* npapi_h_ */