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
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/
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
15 * The Original Code is mozilla.org code.
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.
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.
36 * ***** END LICENSE BLOCK ***** */
47 #if defined(__OS2__) || defined(OS2)
53 #if defined(_WIN32) && !defined(__SYMBIAN32__)
60 #if defined(__SYMBIAN32__)
67 #if defined(__APPLE_CC__) && !defined(XP_UNIX)
73 #if defined(XP_MACOSX)
74 #if !defined(NP_NO_OPENGL)
75 #define NP_NO_OPENGL 1
76 #endif /* !defined(NP_NO_OPENGL) */
78 #define NP_NO_QUICKDRAW
80 #endif /* defined(__LP64__) */
83 #if defined(XP_MACOSX)
84 #include <ApplicationServices/ApplicationServices.h>
86 #include <OpenGL/OpenGL.h>
87 #endif /* !NP_NO_OPENGL */
89 #include <Carbon/Carbon.h>
97 #include <X11/Xutil.h>
101 #if defined(XP_SYMBIAN)
106 /*----------------------------------------------------------------------*/
107 /* Plugin Version Constants */
108 /*----------------------------------------------------------------------*/
110 #define NP_VERSION_MAJOR 0
111 #define NP_VERSION_MINOR 29
114 /* The OS/2 version of Netscape uses RC_DATA to define the
115 mime types, file extensions, etc that are required.
116 Use a vertical bar to separate types, end types with \0.
117 FileVersion and ProductVersion are 32bit ints, all other
118 entries are strings that MUST be terminated with a \0.
122 RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
124 RCDATA NP_INFO_MIMEType { "video/x-video|",
126 RCDATA NP_INFO_FileExtents { "avi|",
128 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
129 "MMOS2 Flc/Fli player(*.flc)\0" }
131 RCDATA NP_INFO_FileVersion { 1,0,0,1 }
132 RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
133 RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
134 RCDATA NP_INFO_InternalName { "NPAVI32\0" )
135 RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
136 RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
137 RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
139 /* RC_DATA types for version info - required */
140 #define NP_INFO_ProductVersion 1
141 #define NP_INFO_MIMEType 2
142 #define NP_INFO_FileOpenName 3
143 #define NP_INFO_FileExtents 4
144 /* RC_DATA types for version info - used if found */
145 #define NP_INFO_FileDescription 5
146 #define NP_INFO_ProductName 6
147 /* RC_DATA types for version info - optional */
148 #define NP_INFO_CompanyName 7
149 #define NP_INFO_FileVersion 8
150 #define NP_INFO_InternalName 9
151 #define NP_INFO_LegalCopyright 10
152 #define NP_INFO_OriginalFilename 11
156 /*----------------------------------------------------------------------*/
157 /* Definition of Basic Types */
158 /*----------------------------------------------------------------------*/
160 typedef unsigned char NPBool
;
161 typedef int16_t NPError
;
162 typedef int16_t NPReason
;
163 typedef char* NPMIMEType
;
165 /*----------------------------------------------------------------------*/
166 /* Structures and definitions */
167 /*----------------------------------------------------------------------*/
169 #if !defined(__LP64__)
170 #if defined(XP_MACOSX)
171 #pragma options align=mac68k
173 #endif /* __LP64__ */
176 * NPP is a plug-in's opaque instance handle
180 void* pdata
; /* plug-in private data */
181 void* ndata
; /* netscape private data */
186 typedef struct _NPStream
188 void* pdata
; /* plug-in private data */
189 void* ndata
; /* netscape private data */
192 uint32_t lastmodified
;
194 const char* headers
; /* Response headers from host.
195 * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
196 * Used for HTTP only; NULL for non-HTTP.
197 * Available from NPP_NewStream onwards.
198 * Plugin should copy this data before storing it.
199 * Includes HTTP status line and all headers,
200 * preferably verbatim as received from server,
201 * headers formatted as in HTTP ("Header: Value"),
202 * and newlines (\n, NOT \r\n) separating lines.
203 * Terminated by \n\0 (NOT \n\n\0). */
206 typedef struct _NPByteRange
208 int32_t offset
; /* negative offset means from the end */
210 struct _NPByteRange
* next
;
213 typedef struct _NPSavedData
219 typedef struct _NPRect
227 typedef struct _NPSize
238 /* These formats describe the format in the memory byte-order. This means if
239 * a 32-bit value of a pixel is viewed on a little-endian system the layout will
240 * be 0xAARRGGBB. The Alpha channel will be stored in the most significant
243 /* 32-bit per pixel 8-bit per channel - premultiplied alpha */
244 NPImageFormatBGRA32
= 0x1,
245 /* 32-bit per pixel 8-bit per channel - 1 unused channel */
246 NPImageFormatBGRX32
= 0x2
249 typedef struct _NPAsyncSurface
251 uint32_t version
; /* Always 0 */
252 NPSize size
; /* Surface size */
253 NPImageFormat format
; /* Image format */
256 uint32_t stride
; /* Image stride */
257 void *data
; /* Bitmap buffer, length is stride * size.height bytes */
260 HANDLE sharedHandle
; /* DXGI 1.1 resource handle */
265 /* Return values for NPP_HandleEvent */
266 #define kNPEventNotHandled 0
267 #define kNPEventHandled 1
268 /* Exact meaning must be spec'd in event model. */
269 #define kNPEventStartIME 2
273 * Unix specific structures and definitions
277 * Callback Structures.
279 * These are used to pass additional platform specific information.
289 } NPAnyCallbackStruct
;
300 } NPSetWindowCallbackStruct
;
306 } NPPrintCallbackStruct
;
312 #if defined(XP_MACOSX)
313 #ifndef NP_NO_QUICKDRAW
314 , NPDrawingModelQuickDraw
= 0
316 , NPDrawingModelCoreGraphics
= 1
317 , NPDrawingModelOpenGL
= 2
318 , NPDrawingModelCoreAnimation
= 3
319 , NPDrawingModelInvalidatingCoreAnimation
= 4
322 , NPDrawingModelSyncWin
= 5
325 , NPDrawingModelSyncX
= 6
327 , NPDrawingModelAsyncBitmapSurface
= 7
329 , NPDrawingModelAsyncWindowsDXGISurface
= 8
336 NPEventModelCarbon
= 0,
338 NPEventModelCocoa
= 1
343 * The following masks are applied on certain platforms to NPNV and
344 * NPPV selectors that pass around pointers to COM interfaces. Newer
345 * compilers on some platforms may generate vtables that are not
346 * compatible with older compilers. To prevent older plugins from
347 * not understanding a new browser's ABI, these masks change the
348 * values of those selectors on those platforms. To remain backwards
349 * compatible with different versions of the browser, plugins can
350 * use these masks to dynamically determine and use the correct C++
351 * ABI that the browser is expecting. This does not apply to Windows
352 * as Microsoft's COM ABI will likely not change.
355 #define NP_ABI_GCC3_MASK 0x10000000
357 * gcc 3.x generated vtables on UNIX and OSX are incompatible with
358 * previous compilers.
360 #if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
361 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
363 #define _NP_ABI_MIXIN_FOR_GCC3 0
366 #if defined(XP_MACOSX)
367 #define NP_ABI_MACHO_MASK 0x01000000
368 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
370 #define _NP_ABI_MIXIN_FOR_MACHO 0
373 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
376 * List of variable names for which NPP_GetValue shall be implemented
379 NPPVpluginNameString
= 1,
380 NPPVpluginDescriptionString
,
381 NPPVpluginWindowBool
,
382 NPPVpluginTransparentBool
,
384 NPPVpluginWindowSize
,
385 NPPVpluginTimerInterval
,
386 NPPVpluginScriptableInstance
= (10 | NP_ABI_MASK
),
387 NPPVpluginScriptableIID
= 11,
388 NPPVjavascriptPushCallerBool
= 12,
389 NPPVpluginKeepLibraryInMemory
= 13,
390 NPPVpluginNeedsXEmbed
= 14,
392 /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
394 NPPVpluginScriptableNPObject
= 15,
396 /* Get the plugin value (as \0-terminated UTF-8 string data) for
397 * form submission if the plugin is part of a form. Use
398 * NPN_MemAlloc() to allocate memory for the string data. Introduced
399 * in NPAPI minor version 15.
403 NPPVpluginUrlRequestsDisplayedBool
= 17,
405 /* Checks if the plugin is interested in receiving the http body of
406 * all http requests (including failed ones, http status != 200).
408 NPPVpluginWantsAllNetworkStreams
= 18,
410 /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
411 NPPVpluginNativeAccessibleAtkPlugId
= 19,
413 /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
414 NPPVpluginCancelSrcStream
= 20,
416 NPPVsupportsAdvancedKeyHandling
= 21,
418 NPPVpluginUsesDOMForCursorBool
= 22,
420 /* Used for negotiating drawing models */
421 NPPVpluginDrawingModel
= 1000
422 #if defined(XP_MACOSX)
423 /* Used for negotiating event models */
424 , NPPVpluginEventModel
= 1001
425 /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
426 , NPPVpluginCoreAnimationLayer
= 1003
429 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
430 , NPPVpluginWindowlessLocalBool
= 2002
433 /* Notification that the plugin just started or stopped playing audio */
434 , NPPVpluginIsPlayingAudio
= 4000
438 * List of variable names for which NPN_GetValue should be implemented.
444 NPNVjavascriptEnabledBool
,
448 NPNVserviceManager
= (10 | NP_ABI_MASK
),
449 NPNVDOMElement
= (11 | NP_ABI_MASK
),
450 NPNVDOMWindow
= (12 | NP_ABI_MASK
),
451 NPNVToolkit
= (13 | NP_ABI_MASK
),
452 NPNVSupportsXEmbedBool
= 14,
454 /* Get the NPObject wrapper for the browser window. */
455 NPNVWindowNPObject
= 15,
457 /* Get the NPObject wrapper for the plugins DOM element. */
458 NPNVPluginElementNPObject
= 16,
460 NPNVSupportsWindowless
= 17,
462 NPNVprivateModeBool
= 18,
464 NPNVsupportsAdvancedKeyHandling
= 21,
466 NPNVdocumentOrigin
= 22,
468 NPNVCSSZoomFactor
= 23,
470 NPNVpluginDrawingModel
= 1000 /* Get the current drawing model (NPDrawingModel) */
471 #if defined(XP_MACOSX)
472 , NPNVcontentsScaleFactor
= 1001
473 #ifndef NP_NO_QUICKDRAW
474 , NPNVsupportsQuickDrawBool
= 2000
476 , NPNVsupportsCoreGraphicsBool
= 2001
477 , NPNVsupportsOpenGLBool
= 2002
478 , NPNVsupportsCoreAnimationBool
= 2003
479 , NPNVsupportsInvalidatingCoreAnimationBool
= 2004
481 , NPNVsupportsAsyncBitmapSurfaceBool
= 2007
483 , NPNVsupportsAsyncWindowsDXGISurfaceBool
= 2008
484 , NPNVpreferredDXGIAdapter
= 2009 /* On success, returns a DXGI_ADAPTER_DESC by value. This
485 is the adapter that should be used for creating a device
486 when using an async DXGI surface provided by the browser.
487 Consumers should use this in conjunction with
488 IDXGIFactory1::EnumAdapters1 and match the AdapterLuid
489 portion of the descriptor. */
491 #if defined(XP_MACOSX)
493 , NPNVsupportsCarbonBool
= 3000 /* TRUE if the browser supports the Carbon event model */
495 , NPNVsupportsCocoaBool
= 3001 /* TRUE if the browser supports the Cocoa event model */
496 , NPNVsupportsUpdatedCocoaTextInputBool
= 3002 /* TRUE if the browser supports the updated
497 Cocoa text input specification. */
499 , NPNVmuteAudioBool
= 4000 /* Request that the browser wants to mute or unmute the plugin */
500 #if defined(XP_MACOSX)
501 , NPNVsupportsCompositingCoreAnimationPluginsBool
= 74656 /* TRUE if the browser supports
502 CA model compositing */
504 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
505 , NPNVSupportsWindowlessLocal
= 2002
515 * The type of Toolkit the widgets use
523 * The type of a NPWindow - it specifies the type of the data structure
524 * returned in the window field.
527 NPWindowTypeWindow
= 1,
531 typedef struct _NPWindow
533 void* window
; /* Platform specific window handle */
534 /* OS/2: x - Position of bottom left corner */
535 /* OS/2: y - relative to visible netscape window */
536 int32_t x
; /* Position of top left corner relative */
537 int32_t y
; /* to a netscape page. */
538 uint32_t width
; /* Maximum window size */
540 NPRect clipRect
; /* Clipping rectangle in port coordinates */
541 #if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
542 void * ws_info
; /* Platform-dependent additional data */
544 NPWindowType type
; /* Is this a window or a drawable? */
547 typedef struct _NPImageExpose
549 char* data
; /* image pointer */
550 int32_t stride
; /* Stride of data image pointer */
551 int32_t depth
; /* Depth of image pointer */
552 int32_t x
; /* Expose x */
553 int32_t y
; /* Expose y */
554 uint32_t width
; /* Expose width */
555 uint32_t height
; /* Expose height */
556 NPSize dataSize
; /* Data buffer size */
557 float translateX
; /* translate X matrix value */
558 float translateY
; /* translate Y matrix value */
559 float scaleX
; /* scale X matrix value */
560 float scaleY
; /* scale Y matrix value */
563 typedef struct _NPFullPrint
565 NPBool pluginPrinted
;/* Set TRUE if plugin handled fullscreen printing */
566 NPBool printOne
; /* TRUE if plugin should print one copy to default
568 void* platformPrint
; /* Platform-specific printing info */
571 typedef struct _NPEmbedPrint
574 void* platformPrint
; /* Platform-specific printing info */
577 typedef struct _NPPrint
579 uint16_t mode
; /* NP_FULL or NP_EMBED */
582 NPFullPrint fullPrint
; /* if mode is NP_FULL */
583 NPEmbedPrint embedPrint
; /* if mode is NP_EMBED */
587 #if defined(XP_MACOSX)
589 typedef EventRecord NPEvent
;
591 #elif defined(XP_SYMBIAN)
592 typedef QEvent NPEvent
;
593 #elif defined(XP_WIN)
594 typedef struct _NPEvent
600 #elif defined(XP_OS2)
601 typedef struct _NPEvent
607 #elif defined(XP_UNIX) && defined(MOZ_X11)
608 typedef XEvent NPEvent
;
610 typedef void* NPEvent
;
613 #if defined(XP_MACOSX)
614 typedef void* NPRegion
;
615 #ifndef NP_NO_QUICKDRAW
616 typedef RgnHandle NPQDRegion
;
618 typedef CGPathRef NPCGRegion
;
619 #elif defined(XP_WIN)
620 typedef HRGN NPRegion
;
621 #elif defined(XP_UNIX) && defined(MOZ_X11)
622 typedef Region NPRegion
;
623 #elif defined(XP_SYMBIAN)
624 typedef QRegion
* NPRegion
;
626 typedef void *NPRegion
;
629 typedef struct _NPNSString NPNSString
;
630 typedef struct _NPNSWindow NPNSWindow
;
631 typedef struct _NPNSMenu NPNSMenu
;
633 #if defined(XP_MACOSX)
634 typedef NPNSMenu NPMenu
;
636 typedef void *NPMenu
;
640 NPCoordinateSpacePlugin
= 1,
641 NPCoordinateSpaceWindow
,
642 NPCoordinateSpaceFlippedWindow
,
643 NPCoordinateSpaceScreen
,
644 NPCoordinateSpaceFlippedScreen
647 #if defined(XP_MACOSX)
649 #ifndef NP_NO_QUICKDRAW
650 typedef struct NP_Port
653 int32_t portx
; /* position inside the topmost window */
656 #endif /* NP_NO_QUICKDRAW */
659 * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
660 * as its drawing model.
663 typedef struct NP_CGContext
665 CGContextRef context
;
666 void *window
; /* A WindowRef under the Carbon event model. */
670 * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
675 typedef struct NP_GLContext
677 CGLContextObj context
;
681 void *window
; /* Can be either an NSWindow or a WindowRef depending on the event model */
684 #endif /* !NP_NO_OPENGL */
687 NPCocoaEventDrawRect
= 1,
688 NPCocoaEventMouseDown
,
690 NPCocoaEventMouseMoved
,
691 NPCocoaEventMouseEntered
,
692 NPCocoaEventMouseExited
,
693 NPCocoaEventMouseDragged
,
696 NPCocoaEventFlagsChanged
,
697 NPCocoaEventFocusChanged
,
698 NPCocoaEventWindowFocusChanged
,
699 NPCocoaEventScrollWheel
,
700 NPCocoaEventTextInput
703 typedef struct _NPCocoaEvent
{
704 NPCocoaEventType type
;
708 uint32_t modifierFlags
;
711 int32_t buttonNumber
;
718 uint32_t modifierFlags
;
719 NPNSString
*characters
;
720 NPNSString
*charactersIgnoringModifiers
;
725 CGContextRef context
;
741 /* Non-standard event types that can be passed to HandleEvent */
743 NPEventType_GetFocusEvent
= (osEvt
+ 16),
744 NPEventType_LoseFocusEvent
,
745 NPEventType_AdjustCursorEvent
,
746 NPEventType_MenuCommandEvent
,
747 NPEventType_ClippingChangedEvent
,
748 NPEventType_ScrollingBeginsEvent
= 1000,
749 NPEventType_ScrollingEndsEvent
751 #endif /* NP_NO_CARBON */
753 #endif /* XP_MACOSX */
756 * Values for mode passed to NPP_New:
762 * Values for stream type passed to NPP_NewStream:
767 #define NP_ASFILEONLY 4
769 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
772 * Flags for NPP_ClearSiteData.
774 #define NP_CLEAR_ALL 0
775 #define NP_CLEAR_CACHE (1 << 0)
777 #if !defined(__LP64__)
778 #if defined(XP_MACOSX)
779 #pragma options align=reset
781 #endif /* __LP64__ */
783 /*----------------------------------------------------------------------*/
784 /* Error and Reason Code definitions */
785 /*----------------------------------------------------------------------*/
788 * Values of type NPError:
791 #define NPERR_NO_ERROR (NPERR_BASE + 0)
792 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
793 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
794 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
795 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
796 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
797 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
798 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
799 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
800 #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
801 #define NPERR_INVALID_URL (NPERR_BASE + 10)
802 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
803 #define NPERR_NO_DATA (NPERR_BASE + 12)
804 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
805 #define NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)
806 #define NPERR_MALFORMED_SITE (NPERR_BASE + 15)
809 * Values of type NPReason:
812 #define NPRES_DONE (NPRES_BASE + 0)
813 #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
814 #define NPRES_USER_BREAK (NPRES_BASE + 2)
817 * Don't use these obsolete error codes any more.
819 #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
820 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
821 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
824 * Version feature information
826 #define NPVERS_HAS_STREAMOUTPUT 8
827 #define NPVERS_HAS_NOTIFICATION 9
828 #define NPVERS_HAS_LIVECONNECT 9
829 #define NPVERS_68K_HAS_LIVECONNECT 11
830 #define NPVERS_HAS_WINDOWLESS 11
831 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
832 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
833 #define NPVERS_HAS_FORM_VALUES 15
834 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16
835 #define NPVERS_HAS_RESPONSE_HEADERS 17
836 #define NPVERS_HAS_NPOBJECT_ENUM 18
837 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
838 #define NPVERS_HAS_ALL_NETWORK_STREAMS 20
839 #define NPVERS_HAS_URL_AND_AUTH_INFO 21
840 #define NPVERS_HAS_PRIVATE_MODE 22
841 #define NPVERS_MACOSX_HAS_COCOA_EVENTS 23
842 #define NPVERS_HAS_ADVANCED_KEY_HANDLING 25
843 #define NPVERS_HAS_URL_REDIRECT_HANDLING 26
844 #define NPVERS_HAS_CLEAR_SITE_DATA 27
846 /*----------------------------------------------------------------------*/
847 /* Function Prototypes */
848 /*----------------------------------------------------------------------*/
851 #define NP_LOADDS _System
860 /* NPP_* functions are provided by the plugin and called by the navigator. */
863 const char* NPP_GetMIMEDescription(void);
866 NPError NP_LOADDS
NPP_New(NPMIMEType pluginType
, NPP instance
,
867 uint16_t mode
, int16_t argc
, char* argn
[],
868 char* argv
[], NPSavedData
* saved
);
869 NPError NP_LOADDS
NPP_Destroy(NPP instance
, NPSavedData
** save
);
870 NPError NP_LOADDS
NPP_SetWindow(NPP instance
, NPWindow
* window
);
871 NPError NP_LOADDS
NPP_NewStream(NPP instance
, NPMIMEType type
,
872 NPStream
* stream
, NPBool seekable
,
874 NPError NP_LOADDS
NPP_DestroyStream(NPP instance
, NPStream
* stream
,
876 int32_t NP_LOADDS
NPP_WriteReady(NPP instance
, NPStream
* stream
);
877 int32_t NP_LOADDS
NPP_Write(NPP instance
, NPStream
* stream
, int32_t offset
,
878 int32_t len
, void* buffer
);
879 void NP_LOADDS
NPP_StreamAsFile(NPP instance
, NPStream
* stream
,
881 void NP_LOADDS
NPP_Print(NPP instance
, NPPrint
* platformPrint
);
882 int16_t NP_LOADDS
NPP_HandleEvent(NPP instance
, void* event
);
883 void NP_LOADDS
NPP_URLNotify(NPP instance
, const char* url
,
884 NPReason reason
, void* notifyData
);
885 NPError NP_LOADDS
NPP_GetValue(NPP instance
, NPPVariable variable
, void *value
);
886 NPError NP_LOADDS
NPP_SetValue(NPP instance
, NPNVariable variable
, void *value
);
887 NPBool NP_LOADDS
NPP_GotFocus(NPP instance
, NPFocusDirection direction
);
888 void NP_LOADDS
NPP_LostFocus(NPP instance
);
889 void NP_LOADDS
NPP_URLRedirectNotify(NPP instance
, const char* url
, int32_t status
, void* notifyData
);
890 NPError NP_LOADDS
NPP_ClearSiteData(const char* site
, uint64_t flags
, uint64_t maxAge
);
891 char** NP_LOADDS
NPP_GetSitesWithData(void);
892 void NP_LOADDS
NPP_DidComposite(NPP instance
);
894 /* NPN_* functions are provided by the navigator and called by the plugin. */
895 void NP_LOADDS
NPN_Version(int* plugin_major
, int* plugin_minor
,
896 int* netscape_major
, int* netscape_minor
);
897 NPError NP_LOADDS
NPN_GetURLNotify(NPP instance
, const char* url
,
898 const char* target
, void* notifyData
);
899 NPError NP_LOADDS
NPN_GetURL(NPP instance
, const char* url
,
901 NPError NP_LOADDS
NPN_PostURLNotify(NPP instance
, const char* url
,
902 const char* target
, uint32_t len
,
903 const char* buf
, NPBool file
,
905 NPError NP_LOADDS
NPN_PostURL(NPP instance
, const char* url
,
906 const char* target
, uint32_t len
,
907 const char* buf
, NPBool file
);
908 NPError NP_LOADDS
NPN_RequestRead(NPStream
* stream
, NPByteRange
* rangeList
);
909 NPError NP_LOADDS
NPN_NewStream(NPP instance
, NPMIMEType type
,
910 const char* target
, NPStream
** stream
);
911 int32_t NP_LOADDS
NPN_Write(NPP instance
, NPStream
* stream
, int32_t len
,
913 NPError NP_LOADDS
NPN_DestroyStream(NPP instance
, NPStream
* stream
,
915 void NP_LOADDS
NPN_Status(NPP instance
, const char* message
);
916 const char* NP_LOADDS
NPN_UserAgent(NPP instance
);
917 void* NP_LOADDS
NPN_MemAlloc(uint32_t size
);
918 void NP_LOADDS
NPN_MemFree(void* ptr
);
919 uint32_t NP_LOADDS
NPN_MemFlush(uint32_t size
);
920 void NP_LOADDS
NPN_ReloadPlugins(NPBool reloadPages
);
921 NPError NP_LOADDS
NPN_GetValue(NPP instance
, NPNVariable variable
,
923 NPError NP_LOADDS
NPN_SetValue(NPP instance
, NPPVariable variable
,
925 void NP_LOADDS
NPN_InvalidateRect(NPP instance
, NPRect
*invalidRect
);
926 void NP_LOADDS
NPN_InvalidateRegion(NPP instance
,
927 NPRegion invalidRegion
);
928 void NP_LOADDS
NPN_ForceRedraw(NPP instance
);
929 void NP_LOADDS
NPN_PushPopupsEnabledState(NPP instance
, NPBool enabled
);
930 void NP_LOADDS
NPN_PopPopupsEnabledState(NPP instance
);
931 void NP_LOADDS
NPN_PluginThreadAsyncCall(NPP instance
,
932 void (*func
) (void *),
934 NPError NP_LOADDS
NPN_GetValueForURL(NPP instance
, NPNURLVariable variable
,
935 const char *url
, char **value
,
937 NPError NP_LOADDS
NPN_SetValueForURL(NPP instance
, NPNURLVariable variable
,
938 const char *url
, const char *value
,
940 NPError NP_LOADDS
NPN_GetAuthenticationInfo(NPP instance
,
941 const char *protocol
,
942 const char *host
, int32_t port
,
945 char **username
, uint32_t *ulen
,
948 uint32_t NP_LOADDS
NPN_ScheduleTimer(NPP instance
, uint32_t interval
, NPBool repeat
, void (*timerFunc
)(NPP npp
, uint32_t timerID
));
949 void NP_LOADDS
NPN_UnscheduleTimer(NPP instance
, uint32_t timerID
);
950 NPError NP_LOADDS
NPN_PopUpContextMenu(NPP instance
, NPMenu
* menu
);
951 NPBool NP_LOADDS
NPN_ConvertPoint(NPP instance
, double sourceX
, double sourceY
, NPCoordinateSpace sourceSpace
, double *destX
, double *destY
, NPCoordinateSpace destSpace
);
952 NPBool NP_LOADDS
NPN_HandleEvent(NPP instance
, void *event
, NPBool handled
);
953 NPBool NP_LOADDS
NPN_UnfocusInstance(NPP instance
, NPFocusDirection direction
);
954 void NP_LOADDS
NPN_URLRedirectResponse(NPP instance
, void* notifyData
, NPBool allow
);
955 NPError NP_LOADDS
NPN_InitAsyncSurface(NPP instance
, NPSize
*size
,
956 NPImageFormat format
, void *initData
,
957 NPAsyncSurface
*surface
);
958 NPError NP_LOADDS
NPN_FinalizeAsyncSurface(NPP instance
, NPAsyncSurface
*surface
);
959 void NP_LOADDS
NPN_SetCurrentAsyncSurface(NPP instance
, NPAsyncSurface
*surface
, NPRect
*changed
);
962 } /* end extern "C" */
965 #endif /* RC_INVOKED */
970 #endif /* npapi_h_ */