williamr@2: /* ***** BEGIN LICENSE BLOCK ***** williamr@2: * Version: NPL 1.1/GPL 2.0/LGPL 2.1 williamr@2: * williamr@2: * The contents of this file are subject to the Netscape Public License williamr@2: * Version 1.1 (the "License"); you may not use this file except in williamr@2: * compliance with the License. You may obtain a copy of the License at williamr@2: * http://www.mozilla.org/NPL/ williamr@2: * williamr@2: * Software distributed under the License is distributed on an "AS IS" basis, williamr@2: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License williamr@2: * for the specific language governing rights and limitations under the williamr@2: * License. williamr@2: * williamr@2: * The Original Code is mozilla.org code. williamr@2: * williamr@2: * The Initial Developer of the Original Code is williamr@2: * Netscape Communications Corporation. williamr@2: * Portions created by the Initial Developer are Copyright (C) 1998 williamr@2: * the Initial Developer. All Rights Reserved. williamr@2: * williamr@2: * Contributor(s): williamr@2: * Portions Copyright (c) 2004-2006, Nokia Corporation williamr@2: * williamr@2: * williamr@2: * Alternatively, the contents of this file may be used under the terms of williamr@2: * either the GNU General Public License Version 2 or later (the "GPL"), or williamr@2: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), williamr@2: * in which case the provisions of the GPL or the LGPL are applicable instead williamr@2: * of those above. If you wish to allow use of your version of this file only williamr@2: * under the terms of either the GPL or the LGPL, and not to allow others to williamr@2: * use your version of this file under the terms of the NPL, indicate your williamr@2: * decision by deleting the provisions above and replace them with the notice williamr@2: * and other provisions required by the GPL or the LGPL. If you do not delete williamr@2: * the provisions above, a recipient may use your version of this file under williamr@2: * the terms of any one of the NPL, the GPL or the LGPL. williamr@2: * williamr@2: * ***** END LICENSE BLOCK ***** */ williamr@2: williamr@2: /* NOTES: williamr@2: * Nokia modified this file, by changing certain variables for the purpose of williamr@2: * porting the file to the Symbian platform on May 1st, 2004. williamr@2: */ williamr@2: williamr@2: /* williamr@2: * Netscape client plug-in API spec williamr@2: */ williamr@2: williamr@2: #ifndef _NPAPI_H_ williamr@2: #define _NPAPI_H_ williamr@2: williamr@4: #define GENERIC_CONTEXTS williamr@4: williamr@2: #ifdef INCLUDE_JAVA williamr@2: #include "jri.h" /* Java Runtime Interface */ williamr@2: #else williamr@2: #ifndef __SYMBIAN32__ williamr@2: #define jref void * williamr@2: #define JRIEnv void williamr@2: #endif williamr@2: #endif williamr@2: williamr@2: #ifdef _WIN32 williamr@2: # ifndef XP_WIN williamr@2: # define XP_WIN 1 williamr@2: # endif /* XP_WIN */ williamr@2: #endif /* _WIN32 */ williamr@2: williamr@2: #ifdef __MWERKS__ williamr@2: # define _declspec __declspec williamr@2: # ifdef macintosh williamr@2: # ifndef XP_MAC williamr@2: # define XP_MAC 1 williamr@2: # endif /* XP_MAC */ williamr@2: # endif /* macintosh */ williamr@2: # ifdef __INTEL__ williamr@2: # undef NULL williamr@2: # ifndef XP_WIN williamr@2: # define XP_WIN 1 williamr@2: # endif /* __INTEL__ */ williamr@2: # endif /* XP_PC */ williamr@2: #endif /* __MWERKS__ */ williamr@2: williamr@2: #ifdef __SYMBIAN32__ williamr@2: #undef XP_WIN williamr@2: #endif williamr@2: williamr@2: #if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) williamr@2: # define XP_MACOSX williamr@2: #endif williamr@2: williamr@2: #ifdef XP_MAC williamr@2: #include williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #ifdef XP_MACOSX williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #ifdef XP_UNIX williamr@2: #include williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #ifdef XP_WIN williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #ifdef __SYMBIAN32__ williamr@2: #include williamr@2: #endif williamr@2: #if defined(XP_MACOSX) && defined(__LP64__) williamr@2: #error 64-bit Netscape plug-ins are not supported on Mac OS X williamr@2: #endif williamr@2: williamr@2: /*----------------------------------------------------------------------*/ williamr@2: /* Plugin Version Constants */ williamr@2: /*----------------------------------------------------------------------*/ williamr@2: williamr@2: #define NP_VERSION_MAJOR 0 williamr@2: #define NP_VERSION_MINOR 18 williamr@2: williamr@2: williamr@2: williamr@2: /*----------------------------------------------------------------------*/ williamr@2: /* Definition of Basic Types */ williamr@2: /*----------------------------------------------------------------------*/ williamr@2: williamr@2: #ifndef _UINT16 williamr@2: #define _UINT16 williamr@2: typedef unsigned short uint16; williamr@2: #endif williamr@2: williamr@2: #ifndef _UINT32 williamr@2: #define _UINT32 williamr@2: #ifdef __LP64__ williamr@2: typedef unsigned int uint32; williamr@2: #else /* __LP64__ */ williamr@2: typedef unsigned long uint32; williamr@2: #endif /* __LP64__ */ williamr@2: #endif williamr@2: williamr@2: #ifndef _INT16 williamr@2: #define _INT16 williamr@2: typedef short int16; williamr@2: #endif williamr@2: williamr@2: #ifndef _INT32 williamr@2: #define _INT32 williamr@2: #ifdef __LP64__ williamr@2: typedef int int32; williamr@2: #else /* __LP64__ */ williamr@2: typedef long int32; williamr@2: #endif /* __LP64__ */ williamr@2: #endif williamr@2: williamr@2: #ifndef FALSE williamr@2: #define FALSE (0) williamr@2: #endif williamr@2: #ifndef TRUE williamr@2: #define TRUE (1) williamr@2: #endif williamr@2: #ifndef NULL williamr@2: #define NULL (0L) williamr@2: #endif williamr@2: williamr@2: typedef unsigned char NPBool; williamr@2: typedef int16 NPError; williamr@2: typedef int16 NPReason; williamr@2: #ifndef __SYMBIAN32__ williamr@2: typedef char* NPMIMEType; williamr@2: #else/* __SYMBIAN32__ */ williamr@2: typedef const TDesC8& NPMIMEType; williamr@2: #endif williamr@2: williamr@2: /*----------------------------------------------------------------------*/ williamr@2: /* Structures and definitions */ williamr@2: /*----------------------------------------------------------------------*/ williamr@2: williamr@2: #if !defined(__LP64__) williamr@2: #if defined(XP_MAC) || defined(XP_MACOSX) williamr@2: #pragma options align=mac68k williamr@2: #endif williamr@2: #endif /* __LP64__ */ williamr@2: williamr@2: /* williamr@2: * NPP is a plug-in's opaque instance handle williamr@2: */ williamr@2: #ifdef __SYMBIAN32__ williamr@2: #ifndef _NP_RUNTIME_H_NPP williamr@2: #define _NP_RUNTIME_H_NPP williamr@2: typedef struct _NPP williamr@2: { williamr@2: void* pdata; /* plug-in private data */ williamr@2: void* ndata; /* netscape private data */ williamr@2: } NPP_t; williamr@2: williamr@2: typedef NPP_t* NPP; williamr@2: #endif // _NP_RUNTIME_H_NPP williamr@2: #else williamr@2: typedef struct _NPP williamr@2: { williamr@2: void* pdata; /* plug-in private data */ williamr@2: void* ndata; /* netscape private data */ williamr@2: } NPP_t; williamr@2: williamr@2: typedef NPP_t* NPP; williamr@2: #endif // williamr@2: williamr@2: typedef struct _NPStream williamr@2: { williamr@2: void* pdata; /* plug-in private data */ williamr@2: void* ndata; /* netscape private data */ williamr@2: #ifndef __SYMBIAN32__ williamr@2: const char* url; williamr@2: #else /*__SYMBIAN32__*/ williamr@2: HBufC* url; williamr@2: #endif williamr@2: uint32 end; williamr@2: uint32 lastmodified; williamr@2: void* notifyData; williamr@2: const char* headers; /* Response headers from host. williamr@2: * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS. williamr@2: * Used for HTTP only; NULL for non-HTTP. williamr@2: * Available from NPP_NewStream onwards. williamr@2: * Plugin should copy this data before storing it. williamr@2: * Includes HTTP status line and all headers, williamr@2: * preferably verbatim as received from server, williamr@2: * headers formatted as in HTTP ("Header: Value"), williamr@2: * and newlines (\n, NOT \r\n) separating lines. williamr@2: * Terminated by \n\0 (NOT \n\n\0). */ williamr@2: } NPStream; williamr@2: williamr@2: williamr@2: typedef struct _NPByteRange williamr@2: { williamr@2: int32 offset; /* negative offset means from the end */ williamr@2: uint32 length; williamr@2: struct _NPByteRange* next; williamr@2: } NPByteRange; williamr@2: williamr@2: williamr@2: typedef struct _NPSavedData williamr@2: { williamr@2: int32 len; williamr@2: void* buf; williamr@2: } NPSavedData; williamr@2: williamr@2: williamr@2: typedef struct _NPRect williamr@2: { williamr@2: uint16 top; williamr@2: uint16 left; williamr@2: uint16 bottom; williamr@2: uint16 right; williamr@2: } NPRect; williamr@2: williamr@2: williamr@2: #ifdef XP_UNIX williamr@2: /* williamr@2: * Unix specific structures and definitions williamr@2: */ williamr@2: williamr@2: /* williamr@2: * Callback Structures. williamr@2: * williamr@2: * These are used to pass additional platform specific information. williamr@2: */ williamr@2: enum { williamr@2: NP_SETWINDOW = 1, williamr@2: NP_PRINT williamr@2: }; williamr@2: williamr@2: typedef struct williamr@2: { williamr@2: int32 type; williamr@2: } NPAnyCallbackStruct; williamr@2: williamr@2: typedef struct williamr@2: { williamr@2: int32 type; williamr@2: Display* display; williamr@2: Visual* visual; williamr@2: Colormap colormap; williamr@2: unsigned int depth; williamr@2: } NPSetWindowCallbackStruct; williamr@2: williamr@2: typedef struct williamr@2: { williamr@2: int32 type; williamr@2: FILE* fp; williamr@2: } NPPrintCallbackStruct; williamr@2: williamr@2: #endif /* XP_UNIX */ williamr@2: williamr@2: /* williamr@2: * The following masks are applied on certain platforms to NPNV and williamr@2: * NPPV selectors that pass around pointers to COM interfaces. Newer williamr@2: * compilers on some platforms may generate vtables that are not williamr@2: * compatible with older compilers. To prevent older plugins from williamr@2: * not understanding a new browser's ABI, these masks change the williamr@2: * values of those selectors on those platforms. To remain backwards williamr@2: * compatible with differenet versions of the browser, plugins can williamr@2: * use these masks to dynamically determine and use the correct C++ williamr@2: * ABI that the browser is expecting. This does not apply to Windows williamr@2: * as Microsoft's COM ABI will likely not change. williamr@2: */ williamr@2: williamr@2: #define NP_ABI_GCC3_MASK 0x10000000 williamr@2: /* williamr@2: * gcc 3.x generated vtables on UNIX and OSX are incompatible with williamr@2: * previous compilers. williamr@2: */ williamr@2: #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) williamr@2: #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK williamr@2: #else williamr@2: #define _NP_ABI_MIXIN_FOR_GCC3 0 williamr@2: #endif williamr@2: williamr@2: #define NP_ABI_MACHO_MASK 0x01000000 williamr@2: /* williamr@2: * On OSX, the Mach-O executable format is significantly williamr@2: * different than CFM. In addition to having a different williamr@2: * C++ ABI, it also has has different C calling convention. williamr@2: * You must use glue code when calling between CFM and williamr@2: * Mach-O C functions. williamr@2: */ williamr@2: #if (defined(TARGET_RT_MAC_MACHO)) williamr@2: #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK williamr@2: #else williamr@2: #define _NP_ABI_MIXIN_FOR_MACHO 0 williamr@2: #endif williamr@2: williamr@2: williamr@2: #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO) williamr@2: williamr@2: /* williamr@2: * List of variable names for which NPP_GetValue shall be implemented williamr@2: */ williamr@2: typedef enum { williamr@2: NPPVpluginNameString = 1, williamr@2: NPPVpluginDescriptionString, williamr@2: NPPVpluginWindowBool, williamr@2: NPPVpluginTransparentBool, williamr@2: williamr@2: NPPVjavaClass, /* Not implemented in WebKit */ williamr@2: NPPVpluginWindowSize, /* Not implemented in WebKit */ williamr@2: NPPVpluginTimerInterval, /* Not implemented in WebKit */ williamr@2: williamr@2: NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), /* Not implemented in WebKit */ williamr@2: NPPVpluginScriptableIID = 11, /* Not implemented in WebKit */ williamr@2: williamr@2: /* 12 and over are available on Mozilla builds starting with 0.9.9 */ williamr@2: NPPVjavascriptPushCallerBool = 12, /* Not implemented in WebKit */ williamr@2: NPPVpluginKeepLibraryInMemory = 13, /* Not implemented in WebKit */ williamr@2: NPPVpluginNeedsXEmbed = 14, /* Not implemented in WebKit */ williamr@2: williamr@2: /* Get the NPObject for scripting the plugin. */ williamr@2: NPPVpluginScriptableNPObject = 15, williamr@2: williamr@2: #ifdef __SYMBIAN32__ williamr@2: // Custom NPP variables, starting from 100 till 1000 williamr@2: NPPVPluginFocusPosition = 100, williamr@2: NPPVPluginDeactivate = 101, williamr@2: NPPVPluginZoom = 102, williamr@2: NPPVPluginPointerEvent = 103, williamr@2: NPPVpluginInteractiveBool = 1000, williamr@2: #endif williamr@2: williamr@2: /* Get the plugin value (as \0-terminated UTF-8 string data) for williamr@2: * form submission if the plugin is part of a form. Use williamr@2: * NPN_MemAlloc() to allocate memory for the string data. williamr@2: */ williamr@2: NPPVformValue = 16, /* Not implemented in WebKit */ williamr@2: NPPVpluginFullScreenBool = 17 /* Not implemented in WebKit */ williamr@2: } NPPVariable; williamr@2: williamr@2: /* williamr@2: * List of variable names for which NPN_GetValue is implemented by Mozilla williamr@2: */ williamr@2: typedef enum { williamr@2: NPNVxDisplay = 1, williamr@2: NPNVxtAppContext, williamr@2: NPNVnetscapeWindow, williamr@2: NPNVjavascriptEnabledBool, williamr@2: NPNVasdEnabledBool, williamr@2: NPNVisOfflineBool, williamr@2: williamr@2: /* 10 and over are available on Mozilla builds starting with 0.9.4 */ williamr@2: NPNVserviceManager = (10 | NP_ABI_MASK), /* Not implemented in WebKit */ williamr@2: NPNVDOMElement = (11 | NP_ABI_MASK), /* Not implemented in WebKit */ williamr@2: NPNVDOMWindow = (12 | NP_ABI_MASK), /* Not implemented in WebKit */ williamr@2: NPNVToolkit = (13 | NP_ABI_MASK), /* Not implemented in WebKit */ williamr@2: NPNVSupportsXEmbedBool = 14, /* Not implemented in WebKit */ williamr@2: williamr@2: /* Get the NPObject wrapper for the browser window. */ williamr@2: NPNVWindowNPObject = 15, williamr@2: williamr@2: /* Get the NPObject wrapper for the plugins DOM element. */ williamr@2: NPNVPluginElementNPObject, williamr@2: williamr@2: #ifdef XP_MACOSX williamr@2: , NPNVpluginDrawingModel = 1000 /* The NPDrawingModel specified by the plugin */ williamr@2: williamr@2: #ifndef NP_NO_QUICKDRAW williamr@2: , NPNVsupportsQuickDrawBool = 2000 /* TRUE if the browser supports the QuickDraw drawing model */ williamr@2: #endif williamr@2: , NPNVsupportsCoreGraphicsBool = 2001 /* TRUE if the browser supports the CoreGraphics drawing model */ williamr@2: , NPNVsupportsOpenGLBool = 2002 /* TRUE if the browser supports the OpenGL drawing model (CGL on Mac) */ williamr@2: #endif /* XP_MACOSX */ williamr@2: williamr@2: /* Get the id of the currently connected access point */ williamr@4: NPNNetworkAccess, williamr@4: NPNVGenericParameter, williamr@4: NPNVSupportsWindowless williamr@2: } NPNVariable; williamr@2: williamr@4: #ifdef GENERIC_CONTEXTS williamr@4: williamr@4: union NPN_GenericParam { williamr@4: williamr@4: NPN_GenericParam(int aIntValue) williamr@4: :intValue(aIntValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericParam(bool aBoolValue) williamr@4: :boolValue(aBoolValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericParam(const TDesC& aStrValue) williamr@4: :strValue(aStrValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericParam(void* aVoidValue) williamr@4: :voidValue(aVoidValue) williamr@4: { williamr@4: williamr@4: } williamr@4: int intValue; williamr@4: bool boolValue; williamr@4: const TDesC& strValue; williamr@4: void* voidValue; williamr@4: }; williamr@4: williamr@4: williamr@4: typedef struct NPN_GenericElement{ williamr@4: williamr@4: NPN_GenericElement(const TDesC& aElementId, int aElementValue) williamr@4: :genericElementId(aElementId), genericElementValue(aElementValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericElement(const TDesC& aElementId, bool aElementValue) williamr@4: :genericElementId(aElementId), genericElementValue(aElementValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericElement(const TDesC& aElementId, void* aElementValue) williamr@4: :genericElementId(aElementId), genericElementValue(aElementValue) williamr@4: { williamr@4: williamr@4: } williamr@4: williamr@4: NPN_GenericElement(const TDesC& aElementId, const TDesC& aElementValue) williamr@4: :genericElementId(aElementId), genericElementValue(aElementValue) williamr@4: { williamr@4: williamr@4: } williamr@4: const TDesC& genericElementId; williamr@4: NPN_GenericParam genericElementValue; williamr@4: } GenericEntry; williamr@4: #endif williamr@2: /* williamr@2: * The type of a NPWindow - it specifies the type of the data structure williamr@2: * returned in the window field. williamr@2: */ williamr@2: typedef enum { williamr@2: NPWindowTypeWindow = 1, williamr@2: NPWindowTypeDrawable williamr@2: } NPWindowType; williamr@2: williamr@2: #ifdef XP_MACOSX williamr@2: williamr@2: /* williamr@2: * The drawing model for a Mac OS X plugin. These are the possible values for the NPNVpluginDrawingModel variable. williamr@2: */ williamr@2: williamr@2: typedef enum { williamr@2: #ifndef NP_NO_QUICKDRAW williamr@2: NPDrawingModelQuickDraw = 0, williamr@2: #endif williamr@2: NPDrawingModelCoreGraphics = 1, williamr@2: NPDrawingModelOpenGL = 2 williamr@2: } NPDrawingModel; williamr@2: williamr@2: #endif williamr@2: williamr@2: typedef struct _NPWindow williamr@2: { williamr@2: void* window; /* Platform specific window handle */ williamr@2: int32 x; /* Position of top left corner relative */ williamr@2: int32 y; /* to a netscape page. */ williamr@2: uint32 width; /* Maximum window size */ williamr@2: uint32 height; williamr@2: NPRect clipRect; /* Clipping rectangle in port coordinates */ williamr@2: /* Used by MAC only. */ williamr@2: #ifdef XP_UNIX williamr@2: void * ws_info; /* Platform-dependent additonal data */ williamr@2: #endif /* XP_UNIX */ williamr@2: NPWindowType type; /* Is this a window or a drawable? */ williamr@2: } NPWindow; williamr@2: williamr@2: williamr@2: typedef struct _NPFullPrint williamr@2: { williamr@2: NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */ williamr@2: /* printing */ williamr@2: NPBool printOne; /* TRUE if plugin should print one copy */ williamr@2: /* to default printer */ williamr@2: void* platformPrint; /* Platform-specific printing info */ williamr@2: } NPFullPrint; williamr@2: williamr@2: typedef struct _NPEmbedPrint williamr@2: { williamr@2: NPWindow window; williamr@2: void* platformPrint; /* Platform-specific printing info */ williamr@2: } NPEmbedPrint; williamr@2: williamr@2: typedef struct _NPPrint williamr@2: { williamr@2: uint16 mode; /* NP_FULL or NP_EMBED */ williamr@2: union williamr@2: { williamr@2: NPFullPrint fullPrint; /* if mode is NP_FULL */ williamr@2: NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ williamr@2: } print; williamr@2: } NPPrint; williamr@2: williamr@2: #if defined(XP_MAC) || defined(XP_MACOSX) williamr@2: typedef EventRecord NPEvent; williamr@2: #elif defined(XP_WIN) williamr@2: typedef struct _NPEvent williamr@2: { williamr@2: uint16 event; williamr@2: uint32 wParam; williamr@2: uint32 lParam; williamr@2: } NPEvent; williamr@2: #elif defined (XP_UNIX) williamr@2: typedef XEvent NPEvent; williamr@2: #elif defined (__SYMBIAN32__) williamr@2: typedef struct _NPEvent williamr@2: { williamr@2: uint32 event; williamr@2: void* param; williamr@2: } NPEvent; williamr@2: #else williamr@2: typedef void* NPEvent; williamr@2: #endif /* XP_MAC */ williamr@2: williamr@2: #if defined(XP_MAC) williamr@2: typedef RgnHandle NPRegion; williamr@2: #elif defined(XP_MACOSX) williamr@2: /* williamr@2: * NPRegion's type depends on the drawing model specified by the plugin (see NPNVpluginDrawingModel). williamr@2: * NPQDRegion represents a QuickDraw RgnHandle and is used with the QuickDraw drawing model. williamr@2: * NPCGRegion repesents a graphical region when using any other drawing model. williamr@2: */ williamr@2: typedef void *NPRegion; williamr@2: #ifndef NP_NO_QUICKDRAW williamr@2: typedef RgnHandle NPQDRegion; williamr@2: #endif williamr@2: typedef CGPathRef NPCGRegion; williamr@2: #elif defined(XP_WIN) williamr@2: typedef HRGN NPRegion; williamr@2: #elif defined(XP_UNIX) williamr@2: typedef Region NPRegion; williamr@2: #else williamr@2: typedef void *NPRegion; williamr@2: #endif /* XP_MAC */ williamr@2: williamr@2: #ifdef XP_MACOSX williamr@2: williamr@2: /* williamr@2: * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics williamr@2: * as its drawing model. williamr@2: */ williamr@2: williamr@2: typedef struct NP_CGContext williamr@2: { williamr@2: CGContextRef context; williamr@2: WindowRef window; williamr@2: } NP_CGContext; williamr@2: williamr@2: /* williamr@2: * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its williamr@2: * drawing model. williamr@2: */ williamr@2: williamr@2: typedef struct NP_GLContext williamr@2: { williamr@2: CGLContextObj context; williamr@2: WindowRef window; williamr@2: } NP_GLContext; williamr@2: williamr@2: #endif /* XP_MACOSX */ williamr@2: williamr@2: #if defined(XP_MAC) || defined(XP_MACOSX) williamr@2: williamr@2: /* williamr@2: * Mac-specific structures and definitions. williamr@2: */ williamr@2: williamr@2: #ifndef NP_NO_QUICKDRAW williamr@2: williamr@2: /* williamr@2: * NP_Port is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelQuickDraw as its williamr@2: * drawing model, or the plugin does not specify a drawing model. williamr@2: * williamr@2: * It is not recommended that new plugins use NPDrawingModelQuickDraw or NP_Port, as QuickDraw has been williamr@2: * deprecated in Mac OS X 10.5. CoreGraphics is the preferred drawing API. williamr@2: * williamr@2: * NP_Port is not available in 64-bit. williamr@2: */ williamr@2: williamr@2: typedef struct NP_Port williamr@2: { williamr@2: CGrafPtr port; /* Grafport */ williamr@2: int32 portx; /* position inside the topmost window */ williamr@2: int32 porty; williamr@2: } NP_Port; williamr@2: williamr@2: #endif /* NP_NO_QUICKDRAW */ williamr@2: williamr@2: /* williamr@2: * Non-standard event types that can be passed to HandleEvent williamr@2: */ williamr@2: #define getFocusEvent (osEvt + 16) williamr@2: #define loseFocusEvent (osEvt + 17) williamr@2: #define adjustCursorEvent (osEvt + 18) williamr@2: williamr@2: #endif /* XP_MAC */ williamr@2: williamr@2: williamr@2: /* williamr@2: * Values for mode passed to NPP_New: williamr@2: */ williamr@2: #define NP_EMBED 1 williamr@2: #define NP_FULL 2 williamr@2: williamr@2: /* williamr@2: * Values for stream type passed to NPP_NewStream: williamr@2: */ williamr@2: #define NP_NORMAL 1 williamr@2: #define NP_SEEK 2 williamr@2: #define NP_ASFILE 3 williamr@2: #define NP_ASFILEONLY 4 williamr@2: williamr@2: #define NP_MAXREADY (((unsigned)(~0)<<1)>>1) williamr@2: williamr@2: #if !defined(__LP64__) williamr@2: #if defined(XP_MAC) || defined(XP_MACOSX) williamr@2: #pragma options align=reset williamr@2: #endif williamr@2: #endif /* __LP64__ */ williamr@2: williamr@2: williamr@2: /*----------------------------------------------------------------------*/ williamr@2: /* Error and Reason Code definitions */ williamr@2: /*----------------------------------------------------------------------*/ williamr@2: williamr@2: /* williamr@2: * Values of type NPError: williamr@2: */ williamr@2: #define NPERR_BASE 0 williamr@2: #define NPERR_NO_ERROR (NPERR_BASE + 0) williamr@2: #define NPERR_GENERIC_ERROR (NPERR_BASE + 1) williamr@2: #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) williamr@2: #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) williamr@2: #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) williamr@2: #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) williamr@2: #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) williamr@2: #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) williamr@2: #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) williamr@2: #define NPERR_INVALID_PARAM (NPERR_BASE + 9) williamr@2: #define NPERR_INVALID_URL (NPERR_BASE + 10) williamr@2: #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) williamr@2: #define NPERR_NO_DATA (NPERR_BASE + 12) williamr@2: #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) williamr@2: williamr@2: /* williamr@2: * Values of type NPReason: williamr@2: */ williamr@2: #define NPRES_BASE 0 williamr@2: #define NPRES_DONE (NPRES_BASE + 0) williamr@2: #define NPRES_NETWORK_ERR (NPRES_BASE + 1) williamr@2: #define NPRES_USER_BREAK (NPRES_BASE + 2) williamr@2: williamr@2: /* williamr@2: * Don't use these obsolete error codes any more. williamr@2: */ williamr@2: #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR williamr@2: #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR williamr@2: #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK williamr@2: williamr@2: /* williamr@2: * Version feature information williamr@2: */ williamr@2: #define NPVERS_HAS_STREAMOUTPUT 8 williamr@2: #define NPVERS_HAS_NOTIFICATION 9 williamr@2: #define NPVERS_HAS_LIVECONNECT 9 williamr@2: #define NPVERS_WIN16_HAS_LIVECONNECT 9 williamr@2: #define NPVERS_68K_HAS_LIVECONNECT 11 williamr@2: #define NPVERS_HAS_WINDOWLESS 11 williamr@2: #define NPVERS_HAS_XPCONNECT_SCRIPTING 13 /* Not implemented in WebKit */ williamr@2: #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 williamr@2: #define NPVERS_HAS_FORM_VALUES 15 /* Not implemented in WebKit; see bug 13061 */ williamr@2: #define NPVERS_HAS_POPUPS_ENABLED_STATE 16 /* Not implemented in WebKit */ williamr@2: #define NPVERS_HAS_RESPONSE_HEADERS 17 williamr@2: #define NPVERS_HAS_NPOBJECT_ENUM 18 williamr@2: williamr@2: williamr@2: /*----------------------------------------------------------------------*/ williamr@2: /* Function Prototypes */ williamr@2: /*----------------------------------------------------------------------*/ williamr@2: williamr@2: #if defined(_WINDOWS) && !defined(WIN32) williamr@2: #define NP_LOADDS _loadds williamr@2: #else williamr@2: #define NP_LOADDS williamr@2: #endif williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: #ifdef __cplusplus williamr@2: extern "C" { williamr@2: #endif williamr@2: #endif williamr@2: williamr@2: /* williamr@2: * NPP_* functions are provided by the plugin and called by the navigator. williamr@2: */ williamr@2: williamr@2: #ifdef XP_UNIX williamr@2: char* NPP_GetMIMEDescription(void); williamr@2: #endif /* XP_UNIX */ williamr@2: williamr@2: #ifdef __SYMBIAN32__ williamr@2: #include williamr@2: IMPORT_C const TDesC* NPP_GetMIMEDescription(void); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: NPError NPP_Initialize(void); williamr@2: #ifdef __SYMBIAN32__ williamr@2: IMPORT_C williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: void NPP_Shutdown(void); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, williamr@2: uint16 mode, int16 argc, char* argn[], williamr@2: char* argv[], NPSavedData* saved); williamr@2: #else williamr@2: NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, williamr@2: uint16 mode, CDesCArray* argn, williamr@2: CDesCArray* argv, NPSavedData* saved); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); williamr@2: NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); williamr@2: NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, williamr@2: NPStream* stream, NPBool seekable, williamr@2: uint16* stype); williamr@2: NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, williamr@2: NPReason reason); williamr@2: int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); williamr@2: int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, williamr@2: int32 len, void* buffer); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, williamr@2: const char* fname); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, williamr@2: const TDesC& fname); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); williamr@2: int16 NPP_HandleEvent(NPP instance, void* event); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, williamr@2: NPReason reason, void* notifyData); williamr@2: jref NP_LOADDS NPP_GetJavaClass(void); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: void NP_LOADDS NPP_URLNotify(NPP instance, const TDesC& url, williamr@2: NPReason reason, void* notifyData); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: williamr@2: #ifdef __SYMBIAN32__ williamr@2: IMPORT_C williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: NPError NPP_GetValue(NPP instance, NPPVariable variable, williamr@2: void *value); williamr@2: NPError NPP_SetValue(NPP instance, NPNVariable variable, williamr@2: void *value); williamr@2: williamr@2: /* williamr@2: * NPN_* functions are provided by the navigator and called by the plugin. williamr@2: */ williamr@2: williamr@2: void NPN_Version(int* plugin_major, int* plugin_minor, williamr@2: int* netscape_major, int* netscape_minor); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: NPError NPN_GetURLNotify(NPP instance, const char* url, williamr@2: const char* target, void* notifyData); williamr@2: NPError NPN_GetURL(NPP instance, const char* url, williamr@2: const char* target); williamr@2: NPError NPN_PostURLNotify(NPP instance, const char* url, williamr@2: const char* target, uint32 len, williamr@2: const char* buf, NPBool file, williamr@2: void* notifyData); williamr@2: NPError NPN_PostURL(NPP instance, const char* url, williamr@2: const char* target, uint32 len, williamr@2: const char* buf, NPBool file); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const TDesC& url, williamr@2: const TDesC* target, void* notifyData); williamr@2: NPError NP_LOADDS NPN_GetURL(NPP instance, const TDesC& url, williamr@2: const TDesC* target); williamr@2: NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const TDesC& url, williamr@2: const TDesC* target, williamr@2: const TDesC& buf, NPBool file, williamr@2: void* notifyData); williamr@2: NPError NP_LOADDS NPN_PostURL(NPP instance, const TDesC& url, williamr@2: const TDesC* target, williamr@2: const TDesC& buf, NPBool file); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: NPError NPN_NewStream(NPP instance, NPMIMEType type, williamr@2: const char* target, NPStream** stream); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, williamr@2: const TDesC* target, NPStream** stream); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer); williamr@2: NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: void NPN_Status(NPP instance, const char* message); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: void NP_LOADDS NPN_Status(NPP instance, const TDesC& message); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: const char* NPN_UserAgent(NPP instance); williamr@2: #else/* __SYMBIAN32__ */ williamr@2: const TDesC* NP_LOADDS NPN_UserAgent(NPP instance); williamr@2: #endif /* __SYMBIAN32__ */ williamr@2: williamr@2: williamr@2: void* NPN_MemAlloc(uint32 size); williamr@2: void NPN_MemFree(void* ptr); williamr@2: uint32 NPN_MemFlush(uint32 size); williamr@2: void NPN_ReloadPlugins(NPBool reloadPages); williamr@2: #ifndef __SYMBIAN32__ williamr@2: JRIEnv* NPN_GetJavaEnv(void); williamr@2: jref NPN_GetJavaPeer(NPP instance); williamr@2: #endif williamr@2: NPError NPN_GetValue(NPP instance, NPNVariable variable, williamr@2: void *value); williamr@2: NPError NPN_SetValue(NPP instance, NPPVariable variable, williamr@2: void *value); williamr@2: void NPN_InvalidateRect(NPP instance, NPRect *invalidRect); williamr@2: void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion); williamr@2: void NPN_ForceRedraw(NPP instance); williamr@2: void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled); williamr@2: void NPN_PopPopupsEnabledState(NPP instance); williamr@2: williamr@2: #ifndef __SYMBIAN32__ williamr@2: #ifdef __cplusplus williamr@2: } /* end extern "C" */ williamr@2: #endif williamr@2: #endif williamr@2: williamr@2: #endif /* _NPAPI_H_ */