epoc32/include/mw/npapi.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/npapi.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/npapi.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,833 @@
     1.4 -npapi.h
     1.5 +/* ***** BEGIN LICENSE BLOCK *****
     1.6 + * Version: NPL 1.1/GPL 2.0/LGPL 2.1
     1.7 + *
     1.8 + * The contents of this file are subject to the Netscape Public License
     1.9 + * Version 1.1 (the "License"); you may not use this file except in
    1.10 + * compliance with the License. You may obtain a copy of the License at
    1.11 + * http://www.mozilla.org/NPL/
    1.12 + *
    1.13 + * Software distributed under the License is distributed on an "AS IS" basis,
    1.14 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    1.15 + * for the specific language governing rights and limitations under the
    1.16 + * License.
    1.17 + *
    1.18 + * The Original Code is mozilla.org code.
    1.19 + *
    1.20 + * The Initial Developer of the Original Code is
    1.21 + * Netscape Communications Corporation.
    1.22 + * Portions created by the Initial Developer are Copyright (C) 1998
    1.23 + * the Initial Developer. All Rights Reserved.
    1.24 + *
    1.25 + * Contributor(s):
    1.26 + *    Portions Copyright (c) 2004-2006, Nokia Corporation
    1.27 + *
    1.28 + *
    1.29 + * Alternatively, the contents of this file may be used under the terms of
    1.30 + * either the GNU General Public License Version 2 or later (the "GPL"), or
    1.31 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    1.32 + * in which case the provisions of the GPL or the LGPL are applicable instead
    1.33 + * of those above. If you wish to allow use of your version of this file only
    1.34 + * under the terms of either the GPL or the LGPL, and not to allow others to
    1.35 + * use your version of this file under the terms of the NPL, indicate your
    1.36 + * decision by deleting the provisions above and replace them with the notice
    1.37 + * and other provisions required by the GPL or the LGPL. If you do not delete
    1.38 + * the provisions above, a recipient may use your version of this file under
    1.39 + * the terms of any one of the NPL, the GPL or the LGPL.
    1.40 + *
    1.41 + * ***** END LICENSE BLOCK ***** */
    1.42 +
    1.43 +/* NOTES:
    1.44 + * Nokia modified this file, by changing certain variables for the purpose of
    1.45 + * porting the file to the Symbian platform on May 1st, 2004.
    1.46 + */
    1.47 +
    1.48 + /*
    1.49 +  *  Netscape client plug-in API spec
    1.50 +  */
    1.51 +
    1.52 +#ifndef _NPAPI_H_
    1.53 +#define _NPAPI_H_
    1.54 +
    1.55 +#ifdef INCLUDE_JAVA
    1.56 +#include "jri.h"                /* Java Runtime Interface */
    1.57 +#else
    1.58 +#ifndef __SYMBIAN32__
    1.59 +#define jref    void *
    1.60 +#define JRIEnv  void
    1.61 +#endif
    1.62 +#endif
    1.63 +
    1.64 +#ifdef _WIN32
    1.65 +#    ifndef XP_WIN
    1.66 +#        define XP_WIN 1
    1.67 +#    endif /* XP_WIN */
    1.68 +#endif /* _WIN32 */
    1.69 +
    1.70 +#ifdef __MWERKS__
    1.71 +#    define _declspec __declspec
    1.72 +#    ifdef macintosh
    1.73 +#        ifndef XP_MAC
    1.74 +#            define XP_MAC 1
    1.75 +#        endif /* XP_MAC */
    1.76 +#    endif /* macintosh */
    1.77 +#    ifdef __INTEL__
    1.78 +#        undef NULL
    1.79 +#        ifndef XP_WIN
    1.80 +#            define XP_WIN 1
    1.81 +#        endif /* __INTEL__ */
    1.82 +#    endif /* XP_PC */
    1.83 +#endif /* __MWERKS__ */
    1.84 +
    1.85 +#ifdef __SYMBIAN32__
    1.86 +#undef XP_WIN
    1.87 +#endif
    1.88 +
    1.89 +#if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__)
    1.90 +#   define XP_MACOSX
    1.91 +#endif
    1.92 +
    1.93 +#ifdef XP_MAC
    1.94 +    #include <Quickdraw.h>
    1.95 +    #include <Events.h>
    1.96 +#endif
    1.97 +
    1.98 +#ifdef XP_MACOSX
    1.99 +    #include <Carbon/Carbon.h>
   1.100 +    #include <ApplicationServices/ApplicationServices.h>
   1.101 +    #include <OpenGL/OpenGL.h>
   1.102 +#endif
   1.103 +
   1.104 +#ifdef XP_UNIX
   1.105 +    #include <X11/Xlib.h>
   1.106 +    #include <X11/Xutil.h>
   1.107 +#endif
   1.108 +
   1.109 +#ifdef XP_WIN
   1.110 +    #include <windows.h>
   1.111 +#endif
   1.112 +
   1.113 +#ifdef __SYMBIAN32__
   1.114 +#include <np_defines.h>
   1.115 +#endif
   1.116 +#if defined(XP_MACOSX) && defined(__LP64__)
   1.117 +#error 64-bit Netscape plug-ins are not supported on Mac OS X
   1.118 +#endif
   1.119 +
   1.120 +/*----------------------------------------------------------------------*/
   1.121 +/*             Plugin Version Constants                                 */
   1.122 +/*----------------------------------------------------------------------*/
   1.123 +
   1.124 +#define NP_VERSION_MAJOR 0
   1.125 +#define NP_VERSION_MINOR 18
   1.126 +
   1.127 +
   1.128 +
   1.129 +/*----------------------------------------------------------------------*/
   1.130 +/*             Definition of Basic Types                                */
   1.131 +/*----------------------------------------------------------------------*/
   1.132 +
   1.133 +#ifndef _UINT16
   1.134 +#define _UINT16
   1.135 +typedef unsigned short uint16;
   1.136 +#endif
   1.137 +
   1.138 +#ifndef _UINT32
   1.139 +#define _UINT32
   1.140 +#ifdef __LP64__
   1.141 +typedef unsigned int uint32;
   1.142 +#else /* __LP64__ */
   1.143 +typedef unsigned long uint32;
   1.144 +#endif /* __LP64__ */
   1.145 +#endif
   1.146 +
   1.147 +#ifndef _INT16
   1.148 +#define _INT16
   1.149 +typedef short int16;
   1.150 +#endif
   1.151 +
   1.152 +#ifndef _INT32
   1.153 +#define _INT32
   1.154 +#ifdef __LP64__
   1.155 +typedef int int32;
   1.156 +#else /* __LP64__ */
   1.157 +typedef long int32;
   1.158 +#endif /* __LP64__ */
   1.159 +#endif
   1.160 +
   1.161 +#ifndef FALSE
   1.162 +#define FALSE (0)
   1.163 +#endif
   1.164 +#ifndef TRUE
   1.165 +#define TRUE (1)
   1.166 +#endif
   1.167 +#ifndef NULL
   1.168 +#define NULL (0L)
   1.169 +#endif
   1.170 +
   1.171 +typedef unsigned char    NPBool;
   1.172 +typedef int16            NPError;
   1.173 +typedef int16            NPReason;
   1.174 +#ifndef __SYMBIAN32__
   1.175 +typedef char*     		 NPMIMEType;
   1.176 +#else/* __SYMBIAN32__ */
   1.177 +typedef const TDesC8& 	 NPMIMEType;
   1.178 +#endif
   1.179 +
   1.180 +/*----------------------------------------------------------------------*/
   1.181 +/*             Structures and definitions             */
   1.182 +/*----------------------------------------------------------------------*/
   1.183 +
   1.184 +#if !defined(__LP64__)
   1.185 +#if defined(XP_MAC) || defined(XP_MACOSX)
   1.186 +#pragma options align=mac68k
   1.187 +#endif
   1.188 +#endif /* __LP64__ */
   1.189 +
   1.190 +/*
   1.191 + *  NPP is a plug-in's opaque instance handle
   1.192 + */
   1.193 +#ifdef __SYMBIAN32__ 
   1.194 +#ifndef _NP_RUNTIME_H_NPP
   1.195 +#define _NP_RUNTIME_H_NPP
   1.196 +typedef struct _NPP
   1.197 +{
   1.198 +    void*    pdata;            /* plug-in private data */
   1.199 +    void*    ndata;            /* netscape private data */
   1.200 +} NPP_t;
   1.201 +
   1.202 +typedef NPP_t*    NPP;
   1.203 +#endif // _NP_RUNTIME_H_NPP
   1.204 +#else
   1.205 +typedef struct _NPP
   1.206 +{
   1.207 +    void*    pdata;            /* plug-in private data */
   1.208 +    void*    ndata;            /* netscape private data */
   1.209 +} NPP_t;
   1.210 +
   1.211 +typedef NPP_t*    NPP;
   1.212 +#endif //
   1.213 +
   1.214 +typedef struct _NPStream
   1.215 +{
   1.216 +    void*        pdata;        /* plug-in private data */
   1.217 +    void*        ndata;        /* netscape private data */
   1.218 +#ifndef __SYMBIAN32__ 
   1.219 +    const char*  url;
   1.220 +#else /*__SYMBIAN32__*/
   1.221 +    HBufC* url;
   1.222 +#endif
   1.223 +    uint32       end;
   1.224 +    uint32       lastmodified;
   1.225 +    void*        notifyData;
   1.226 +    const char*  headers;      /* Response headers from host.
   1.227 +                                * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
   1.228 +                                * Used for HTTP only; NULL for non-HTTP.
   1.229 +                                * Available from NPP_NewStream onwards.
   1.230 +                                * Plugin should copy this data before storing it.
   1.231 +                                * Includes HTTP status line and all headers,
   1.232 +                                * preferably verbatim as received from server,
   1.233 +                                * headers formatted as in HTTP ("Header: Value"),
   1.234 +                                * and newlines (\n, NOT \r\n) separating lines.
   1.235 +                                * Terminated by \n\0 (NOT \n\n\0). */
   1.236 +} NPStream;
   1.237 +
   1.238 +
   1.239 +typedef struct _NPByteRange
   1.240 +{
   1.241 +    int32      offset;         /* negative offset means from the end */
   1.242 +    uint32     length;
   1.243 +    struct _NPByteRange* next;
   1.244 +} NPByteRange;
   1.245 +
   1.246 +
   1.247 +typedef struct _NPSavedData
   1.248 +{
   1.249 +    int32    len;
   1.250 +    void*    buf;
   1.251 +} NPSavedData;
   1.252 +
   1.253 +
   1.254 +typedef struct _NPRect
   1.255 +{
   1.256 +    uint16    top;
   1.257 +    uint16    left;
   1.258 +    uint16    bottom;
   1.259 +    uint16    right;
   1.260 +} NPRect;
   1.261 +
   1.262 +
   1.263 +#ifdef XP_UNIX
   1.264 +/*
   1.265 + * Unix specific structures and definitions
   1.266 + */
   1.267 +
   1.268 +/*
   1.269 + * Callback Structures.
   1.270 + *
   1.271 + * These are used to pass additional platform specific information.
   1.272 + */
   1.273 +enum {
   1.274 +    NP_SETWINDOW = 1,
   1.275 +    NP_PRINT
   1.276 +};
   1.277 +
   1.278 +typedef struct
   1.279 +{
   1.280 +    int32        type;
   1.281 +} NPAnyCallbackStruct;
   1.282 +
   1.283 +typedef struct
   1.284 +{
   1.285 +    int32           type;
   1.286 +    Display*        display;
   1.287 +    Visual*         visual;
   1.288 +    Colormap        colormap;
   1.289 +    unsigned int    depth;
   1.290 +} NPSetWindowCallbackStruct;
   1.291 +
   1.292 +typedef struct
   1.293 +{
   1.294 +    int32            type;
   1.295 +    FILE*            fp;
   1.296 +} NPPrintCallbackStruct;
   1.297 +
   1.298 +#endif /* XP_UNIX */
   1.299 +
   1.300 +/*
   1.301 + *   The following masks are applied on certain platforms to NPNV and 
   1.302 + *   NPPV selectors that pass around pointers to COM interfaces. Newer 
   1.303 + *   compilers on some platforms may generate vtables that are not 
   1.304 + *   compatible with older compilers. To prevent older plugins from 
   1.305 + *   not understanding a new browser's ABI, these masks change the 
   1.306 + *   values of those selectors on those platforms. To remain backwards
   1.307 + *   compatible with differenet versions of the browser, plugins can 
   1.308 + *   use these masks to dynamically determine and use the correct C++
   1.309 + *   ABI that the browser is expecting. This does not apply to Windows 
   1.310 + *   as Microsoft's COM ABI will likely not change.
   1.311 + */
   1.312 +
   1.313 +#define NP_ABI_GCC3_MASK  0x10000000
   1.314 +/*
   1.315 + *   gcc 3.x generated vtables on UNIX and OSX are incompatible with 
   1.316 + *   previous compilers.
   1.317 + */
   1.318 +#if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
   1.319 +#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
   1.320 +#else
   1.321 +#define _NP_ABI_MIXIN_FOR_GCC3 0
   1.322 +#endif
   1.323 +
   1.324 +#define NP_ABI_MACHO_MASK 0x01000000
   1.325 +/*
   1.326 + *   On OSX, the Mach-O executable format is significantly
   1.327 + *   different than CFM. In addition to having a different
   1.328 + *   C++ ABI, it also has has different C calling convention.
   1.329 + *   You must use glue code when calling between CFM and
   1.330 + *   Mach-O C functions. 
   1.331 + */
   1.332 +#if (defined(TARGET_RT_MAC_MACHO))
   1.333 +#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
   1.334 +#else
   1.335 +#define _NP_ABI_MIXIN_FOR_MACHO 0
   1.336 +#endif
   1.337 +
   1.338 +
   1.339 +#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
   1.340 +
   1.341 +/*
   1.342 + * List of variable names for which NPP_GetValue shall be implemented
   1.343 + */
   1.344 +typedef enum {
   1.345 +    NPPVpluginNameString = 1,
   1.346 +    NPPVpluginDescriptionString,
   1.347 +    NPPVpluginWindowBool,
   1.348 +    NPPVpluginTransparentBool,
   1.349 +
   1.350 +    NPPVjavaClass,                /* Not implemented in WebKit */
   1.351 +    NPPVpluginWindowSize,         /* Not implemented in WebKit */
   1.352 +    NPPVpluginTimerInterval,      /* Not implemented in WebKit */
   1.353 +
   1.354 +    NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), /* Not implemented in WebKit */
   1.355 +    NPPVpluginScriptableIID = 11, /* Not implemented in WebKit */
   1.356 +
   1.357 +    /* 12 and over are available on Mozilla builds starting with 0.9.9 */
   1.358 +    NPPVjavascriptPushCallerBool = 12,  /* Not implemented in WebKit */
   1.359 +    NPPVpluginKeepLibraryInMemory = 13, /* Not implemented in WebKit */
   1.360 +    NPPVpluginNeedsXEmbed         = 14, /* Not implemented in WebKit */
   1.361 +
   1.362 +    /* Get the NPObject for scripting the plugin. */
   1.363 +    NPPVpluginScriptableNPObject  = 15,
   1.364 +
   1.365 +#ifdef __SYMBIAN32__
   1.366 +    // Custom NPP variables, starting from 100 till 1000
   1.367 +    NPPVPluginFocusPosition = 100,    
   1.368 +    NPPVPluginDeactivate = 101,
   1.369 +    NPPVPluginZoom = 102,
   1.370 +    NPPVPluginPointerEvent = 103,
   1.371 +    NPPVpluginInteractiveBool = 1000,
   1.372 +#endif
   1.373 +
   1.374 +    /* Get the plugin value (as \0-terminated UTF-8 string data) for
   1.375 +     * form submission if the plugin is part of a form. Use
   1.376 +     * NPN_MemAlloc() to allocate memory for the string data.
   1.377 +     */
   1.378 +    NPPVformValue = 16,    /* Not implemented in WebKit */
   1.379 +    NPPVpluginFullScreenBool = 17 /* Not implemented in WebKit */
   1.380 +} NPPVariable;
   1.381 +
   1.382 +/*
   1.383 + * List of variable names for which NPN_GetValue is implemented by Mozilla
   1.384 + */
   1.385 +typedef enum {
   1.386 +    NPNVxDisplay = 1,
   1.387 +    NPNVxtAppContext,
   1.388 +    NPNVnetscapeWindow,
   1.389 +    NPNVjavascriptEnabledBool,
   1.390 +    NPNVasdEnabledBool,
   1.391 +    NPNVisOfflineBool,
   1.392 +
   1.393 +    /* 10 and over are available on Mozilla builds starting with 0.9.4 */
   1.394 +    NPNVserviceManager = (10 | NP_ABI_MASK),  /* Not implemented in WebKit */
   1.395 +    NPNVDOMElement     = (11 | NP_ABI_MASK),  /* Not implemented in WebKit */
   1.396 +    NPNVDOMWindow      = (12 | NP_ABI_MASK),  /* Not implemented in WebKit */
   1.397 +    NPNVToolkit        = (13 | NP_ABI_MASK),  /* Not implemented in WebKit */
   1.398 +    NPNVSupportsXEmbedBool = 14,              /* Not implemented in WebKit */
   1.399 +
   1.400 +    /* Get the NPObject wrapper for the browser window. */
   1.401 +    NPNVWindowNPObject = 15,
   1.402 +
   1.403 +    /* Get the NPObject wrapper for the plugins DOM element. */
   1.404 +    NPNVPluginElementNPObject,
   1.405 +
   1.406 +#ifdef XP_MACOSX
   1.407 +    , NPNVpluginDrawingModel = 1000 /* The NPDrawingModel specified by the plugin */
   1.408 +
   1.409 +#ifndef NP_NO_QUICKDRAW
   1.410 +    , NPNVsupportsQuickDrawBool = 2000 /* TRUE if the browser supports the QuickDraw drawing model */
   1.411 +#endif
   1.412 +    , NPNVsupportsCoreGraphicsBool = 2001 /* TRUE if the browser supports the CoreGraphics drawing model */
   1.413 +    , NPNVsupportsOpenGLBool = 2002 /* TRUE if the browser supports the OpenGL drawing model (CGL on Mac) */
   1.414 +#endif /* XP_MACOSX */
   1.415 +    
   1.416 +    /* Get the id of the currently connected access point */
   1.417 +    NPNNetworkAccess
   1.418 +} NPNVariable;
   1.419 +
   1.420 +/*
   1.421 + * The type of a NPWindow - it specifies the type of the data structure
   1.422 + * returned in the window field.
   1.423 + */
   1.424 +typedef enum {
   1.425 +    NPWindowTypeWindow = 1,
   1.426 +    NPWindowTypeDrawable
   1.427 +} NPWindowType;
   1.428 +
   1.429 +#ifdef XP_MACOSX
   1.430 +
   1.431 +/*
   1.432 + * The drawing model for a Mac OS X plugin.  These are the possible values for the NPNVpluginDrawingModel variable.
   1.433 + */
   1.434 + 
   1.435 +typedef enum {
   1.436 +#ifndef NP_NO_QUICKDRAW
   1.437 +    NPDrawingModelQuickDraw = 0,
   1.438 +#endif
   1.439 +    NPDrawingModelCoreGraphics = 1,
   1.440 +    NPDrawingModelOpenGL = 2
   1.441 +} NPDrawingModel;
   1.442 +
   1.443 +#endif
   1.444 +
   1.445 +typedef struct _NPWindow
   1.446 +{
   1.447 +    void*    window;     /* Platform specific window handle */
   1.448 +    int32    x;            /* Position of top left corner relative */
   1.449 +    int32    y;            /*    to a netscape page.                    */
   1.450 +    uint32    width;        /* Maximum window size */
   1.451 +    uint32    height;
   1.452 +    NPRect    clipRect;    /* Clipping rectangle in port coordinates */
   1.453 +                        /* Used by MAC only.              */
   1.454 +#ifdef XP_UNIX
   1.455 +    void *    ws_info;    /* Platform-dependent additonal data */
   1.456 +#endif /* XP_UNIX */
   1.457 +    NPWindowType type;    /* Is this a window or a drawable? */
   1.458 +} NPWindow;
   1.459 +
   1.460 +
   1.461 +typedef struct _NPFullPrint
   1.462 +{
   1.463 +    NPBool    pluginPrinted;    /* Set TRUE if plugin handled fullscreen */
   1.464 +                            /*    printing                             */
   1.465 +    NPBool    printOne;        /* TRUE if plugin should print one copy  */
   1.466 +                            /*    to default printer                     */
   1.467 +    void*    platformPrint;    /* Platform-specific printing info */
   1.468 +} NPFullPrint;
   1.469 +
   1.470 +typedef struct _NPEmbedPrint
   1.471 +{
   1.472 +    NPWindow    window;
   1.473 +    void*    platformPrint;    /* Platform-specific printing info */
   1.474 +} NPEmbedPrint;
   1.475 +
   1.476 +typedef struct _NPPrint
   1.477 +{
   1.478 +    uint16    mode;                        /* NP_FULL or NP_EMBED */
   1.479 +    union
   1.480 +    {
   1.481 +        NPFullPrint     fullPrint;        /* if mode is NP_FULL */
   1.482 +        NPEmbedPrint    embedPrint;        /* if mode is NP_EMBED */
   1.483 +    } print;
   1.484 +} NPPrint;
   1.485 +
   1.486 +#if defined(XP_MAC) || defined(XP_MACOSX)
   1.487 +typedef EventRecord    NPEvent;
   1.488 +#elif defined(XP_WIN)
   1.489 +typedef struct _NPEvent
   1.490 +{
   1.491 +    uint16   event;
   1.492 +    uint32   wParam;
   1.493 +    uint32   lParam;
   1.494 +} NPEvent;
   1.495 +#elif defined (XP_UNIX)
   1.496 +typedef XEvent NPEvent;
   1.497 +#elif defined (__SYMBIAN32__)
   1.498 +typedef struct _NPEvent
   1.499 +{
   1.500 +    uint32   event;
   1.501 +    void*    param;
   1.502 +} NPEvent;
   1.503 +#else
   1.504 +typedef void*            NPEvent;
   1.505 +#endif /* XP_MAC */
   1.506 +
   1.507 +#if defined(XP_MAC)
   1.508 +typedef RgnHandle NPRegion;
   1.509 +#elif defined(XP_MACOSX)
   1.510 +/* 
   1.511 + * NPRegion's type depends on the drawing model specified by the plugin (see NPNVpluginDrawingModel).
   1.512 + * NPQDRegion represents a QuickDraw RgnHandle and is used with the QuickDraw drawing model.
   1.513 + * NPCGRegion repesents a graphical region when using any other drawing model.
   1.514 + */
   1.515 +typedef void *NPRegion;
   1.516 +#ifndef NP_NO_QUICKDRAW
   1.517 +typedef RgnHandle NPQDRegion;
   1.518 +#endif
   1.519 +typedef CGPathRef NPCGRegion;
   1.520 +#elif defined(XP_WIN)
   1.521 +typedef HRGN NPRegion;
   1.522 +#elif defined(XP_UNIX)
   1.523 +typedef Region NPRegion;
   1.524 +#else
   1.525 +typedef void *NPRegion;
   1.526 +#endif /* XP_MAC */
   1.527 +
   1.528 +#ifdef XP_MACOSX
   1.529 +
   1.530 +/* 
   1.531 + * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
   1.532 + * as its drawing model.
   1.533 + */
   1.534 +
   1.535 +typedef struct NP_CGContext
   1.536 +{
   1.537 +    CGContextRef context;
   1.538 +    WindowRef window;
   1.539 +} NP_CGContext;
   1.540 +
   1.541 +/* 
   1.542 + * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
   1.543 + * drawing model.
   1.544 + */
   1.545 +
   1.546 +typedef struct NP_GLContext
   1.547 +{
   1.548 +    CGLContextObj context;
   1.549 +    WindowRef window;
   1.550 +} NP_GLContext;
   1.551 +
   1.552 +#endif /* XP_MACOSX */
   1.553 +
   1.554 +#if defined(XP_MAC) || defined(XP_MACOSX)
   1.555 +
   1.556 +/*
   1.557 + *  Mac-specific structures and definitions.
   1.558 + */
   1.559 +
   1.560 +#ifndef NP_NO_QUICKDRAW
   1.561 +
   1.562 +/* 
   1.563 + * NP_Port is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelQuickDraw as its
   1.564 + * drawing model, or the plugin does not specify a drawing model.
   1.565 + *
   1.566 + * It is not recommended that new plugins use NPDrawingModelQuickDraw or NP_Port, as QuickDraw has been
   1.567 + * deprecated in Mac OS X 10.5.  CoreGraphics is the preferred drawing API.
   1.568 + *
   1.569 + * NP_Port is not available in 64-bit.
   1.570 + */
   1.571 + 
   1.572 +typedef struct NP_Port
   1.573 +{
   1.574 +    CGrafPtr     port;        /* Grafport */
   1.575 +    int32        portx;        /* position inside the topmost window */
   1.576 +    int32        porty;
   1.577 +} NP_Port;
   1.578 +
   1.579 +#endif /* NP_NO_QUICKDRAW */
   1.580 +
   1.581 +/*
   1.582 + *  Non-standard event types that can be passed to HandleEvent
   1.583 + */
   1.584 +#define getFocusEvent        (osEvt + 16)
   1.585 +#define loseFocusEvent        (osEvt + 17)
   1.586 +#define adjustCursorEvent   (osEvt + 18)
   1.587 +
   1.588 +#endif /* XP_MAC */
   1.589 +
   1.590 +
   1.591 +/*
   1.592 + * Values for mode passed to NPP_New:
   1.593 + */
   1.594 +#define NP_EMBED        1
   1.595 +#define NP_FULL         2
   1.596 +
   1.597 +/*
   1.598 + * Values for stream type passed to NPP_NewStream:
   1.599 + */
   1.600 +#define NP_NORMAL        1
   1.601 +#define NP_SEEK         2
   1.602 +#define NP_ASFILE        3
   1.603 +#define NP_ASFILEONLY        4
   1.604 +
   1.605 +#define NP_MAXREADY    (((unsigned)(~0)<<1)>>1)
   1.606 +
   1.607 +#if !defined(__LP64__)
   1.608 +#if defined(XP_MAC) || defined(XP_MACOSX)
   1.609 +#pragma options align=reset
   1.610 +#endif
   1.611 +#endif /* __LP64__ */
   1.612 +
   1.613 +
   1.614 +/*----------------------------------------------------------------------*/
   1.615 +/*             Error and Reason Code definitions            */
   1.616 +/*----------------------------------------------------------------------*/
   1.617 +
   1.618 +/*
   1.619 + *    Values of type NPError:
   1.620 + */
   1.621 +#define NPERR_BASE                            0
   1.622 +#define NPERR_NO_ERROR                        (NPERR_BASE + 0)
   1.623 +#define NPERR_GENERIC_ERROR                    (NPERR_BASE + 1)
   1.624 +#define NPERR_INVALID_INSTANCE_ERROR        (NPERR_BASE + 2)
   1.625 +#define NPERR_INVALID_FUNCTABLE_ERROR        (NPERR_BASE + 3)
   1.626 +#define NPERR_MODULE_LOAD_FAILED_ERROR        (NPERR_BASE + 4)
   1.627 +#define NPERR_OUT_OF_MEMORY_ERROR            (NPERR_BASE + 5)
   1.628 +#define NPERR_INVALID_PLUGIN_ERROR            (NPERR_BASE + 6)
   1.629 +#define NPERR_INVALID_PLUGIN_DIR_ERROR        (NPERR_BASE + 7)
   1.630 +#define NPERR_INCOMPATIBLE_VERSION_ERROR    (NPERR_BASE + 8)
   1.631 +#define NPERR_INVALID_PARAM                (NPERR_BASE + 9)
   1.632 +#define NPERR_INVALID_URL                    (NPERR_BASE + 10)
   1.633 +#define NPERR_FILE_NOT_FOUND                (NPERR_BASE + 11)
   1.634 +#define NPERR_NO_DATA                        (NPERR_BASE + 12)
   1.635 +#define NPERR_STREAM_NOT_SEEKABLE            (NPERR_BASE + 13)
   1.636 +
   1.637 +/*
   1.638 + *    Values of type NPReason:
   1.639 + */
   1.640 +#define NPRES_BASE                0
   1.641 +#define NPRES_DONE                    (NPRES_BASE + 0)
   1.642 +#define NPRES_NETWORK_ERR            (NPRES_BASE + 1)
   1.643 +#define NPRES_USER_BREAK            (NPRES_BASE + 2)
   1.644 +
   1.645 +/*
   1.646 + *      Don't use these obsolete error codes any more.
   1.647 + */
   1.648 +#define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
   1.649 +#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
   1.650 +#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
   1.651 +
   1.652 +/*
   1.653 + * Version feature information
   1.654 + */
   1.655 +#define NPVERS_HAS_STREAMOUTPUT     8
   1.656 +#define NPVERS_HAS_NOTIFICATION     9
   1.657 +#define NPVERS_HAS_LIVECONNECT        9
   1.658 +#define NPVERS_WIN16_HAS_LIVECONNECT    9
   1.659 +#define NPVERS_68K_HAS_LIVECONNECT    11
   1.660 +#define NPVERS_HAS_WINDOWLESS       11
   1.661 +#define NPVERS_HAS_XPCONNECT_SCRIPTING    13  /* Not implemented in WebKit */
   1.662 +#define NPVERS_HAS_NPRUNTIME_SCRIPTING    14
   1.663 +#define NPVERS_HAS_FORM_VALUES            15  /* Not implemented in WebKit; see bug 13061 */
   1.664 +#define NPVERS_HAS_POPUPS_ENABLED_STATE   16  /* Not implemented in WebKit */
   1.665 +#define NPVERS_HAS_RESPONSE_HEADERS       17
   1.666 +#define NPVERS_HAS_NPOBJECT_ENUM          18
   1.667 +
   1.668 +
   1.669 +/*----------------------------------------------------------------------*/
   1.670 +/*             Function Prototypes                */
   1.671 +/*----------------------------------------------------------------------*/
   1.672 +
   1.673 +#if defined(_WINDOWS) && !defined(WIN32)
   1.674 +#define NP_LOADDS  _loadds
   1.675 +#else
   1.676 +#define NP_LOADDS
   1.677 +#endif
   1.678 +
   1.679 +#ifndef __SYMBIAN32__
   1.680 + #ifdef __cplusplus
   1.681 + extern "C" {
   1.682 + #endif
   1.683 +#endif
   1.684 +
   1.685 +/*
   1.686 + * NPP_* functions are provided by the plugin and called by the navigator.
   1.687 + */
   1.688 +
   1.689 +#ifdef XP_UNIX
   1.690 +char*                    NPP_GetMIMEDescription(void);
   1.691 +#endif /* XP_UNIX */
   1.692 +
   1.693 +#ifdef __SYMBIAN32__
   1.694 +#include <badesca.h>
   1.695 +IMPORT_C const TDesC* NPP_GetMIMEDescription(void);
   1.696 +#endif /* __SYMBIAN32__ */
   1.697 +
   1.698 +NPError     NPP_Initialize(void);
   1.699 +#ifdef __SYMBIAN32__
   1.700 +IMPORT_C
   1.701 +#endif /* __SYMBIAN32__ */
   1.702 +void        NPP_Shutdown(void);
   1.703 +
   1.704 +#ifndef __SYMBIAN32__
   1.705 +NPError     NP_LOADDS    NPP_New(NPMIMEType pluginType, NPP instance,
   1.706 +                                uint16 mode, int16 argc, char* argn[],
   1.707 +                                char* argv[], NPSavedData* saved);
   1.708 +#else
   1.709 +NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
   1.710 +              uint16 mode, CDesCArray* argn,
   1.711 +              CDesCArray* argv, NPSavedData* saved);
   1.712 +#endif /* __SYMBIAN32__ */
   1.713 +
   1.714 +NPError     NP_LOADDS    NPP_Destroy(NPP instance, NPSavedData** save);
   1.715 +NPError     NP_LOADDS    NPP_SetWindow(NPP instance, NPWindow* window);
   1.716 +NPError     NP_LOADDS    NPP_NewStream(NPP instance, NPMIMEType type,
   1.717 +                                      NPStream* stream, NPBool seekable,
   1.718 +                                      uint16* stype);
   1.719 +NPError     NP_LOADDS    NPP_DestroyStream(NPP instance, NPStream* stream,
   1.720 +                                          NPReason reason);
   1.721 +int32        NP_LOADDS    NPP_WriteReady(NPP instance, NPStream* stream);
   1.722 +int32        NP_LOADDS    NPP_Write(NPP instance, NPStream* stream, int32 offset,
   1.723 +                                  int32 len, void* buffer);
   1.724 +
   1.725 +#ifndef __SYMBIAN32__
   1.726 +void        NP_LOADDS    NPP_StreamAsFile(NPP instance, NPStream* stream,
   1.727 +                                         const char* fname);
   1.728 +#else/* __SYMBIAN32__ */
   1.729 +void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
   1.730 +                                   const TDesC& fname);
   1.731 +#endif /* __SYMBIAN32__ */
   1.732 +
   1.733 +void        NP_LOADDS    NPP_Print(NPP instance, NPPrint* platformPrint);
   1.734 +int16            NPP_HandleEvent(NPP instance, void* event);
   1.735 +
   1.736 +#ifndef __SYMBIAN32__
   1.737 +void        NP_LOADDS    NPP_URLNotify(NPP instance, const char* url,
   1.738 +                                      NPReason reason, void* notifyData);
   1.739 +jref        NP_LOADDS            NPP_GetJavaClass(void);
   1.740 +#else/* __SYMBIAN32__ */
   1.741 +void    NP_LOADDS NPP_URLNotify(NPP instance, const TDesC& url,
   1.742 +                                NPReason reason, void* notifyData);
   1.743 +#endif /* __SYMBIAN32__ */
   1.744 +
   1.745 +
   1.746 +#ifdef __SYMBIAN32__
   1.747 +IMPORT_C
   1.748 +#endif /* __SYMBIAN32__ */
   1.749 +NPError     NPP_GetValue(NPP instance, NPPVariable variable,
   1.750 +                                     void *value);
   1.751 +NPError     NPP_SetValue(NPP instance, NPNVariable variable,
   1.752 +                                     void *value);
   1.753 +
   1.754 +/*
   1.755 + * NPN_* functions are provided by the navigator and called by the plugin.
   1.756 + */
   1.757 +
   1.758 +void        NPN_Version(int* plugin_major, int* plugin_minor,
   1.759 +                            int* netscape_major, int* netscape_minor);
   1.760 +
   1.761 +#ifndef __SYMBIAN32__
   1.762 +NPError     NPN_GetURLNotify(NPP instance, const char* url,
   1.763 +                                 const char* target, void* notifyData);
   1.764 +NPError     NPN_GetURL(NPP instance, const char* url,
   1.765 +                           const char* target);
   1.766 +NPError     NPN_PostURLNotify(NPP instance, const char* url,
   1.767 +                                  const char* target, uint32 len,
   1.768 +                                  const char* buf, NPBool file,
   1.769 +                                  void* notifyData);
   1.770 +NPError     NPN_PostURL(NPP instance, const char* url,
   1.771 +                            const char* target, uint32 len,
   1.772 +                            const char* buf, NPBool file);
   1.773 +#else/* __SYMBIAN32__ */
   1.774 +NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const TDesC& url,
   1.775 +                                   const TDesC* target, void* notifyData);
   1.776 +NPError NP_LOADDS NPN_GetURL(NPP instance, const TDesC& url,
   1.777 +                             const TDesC* target);
   1.778 +NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const TDesC& url,
   1.779 +                                    const TDesC* target,
   1.780 +                                    const TDesC& buf, NPBool file,
   1.781 +                                    void* notifyData);
   1.782 +NPError NP_LOADDS NPN_PostURL(NPP instance, const TDesC& url,
   1.783 +                              const TDesC* target,
   1.784 +                              const TDesC& buf, NPBool file);
   1.785 +#endif /* __SYMBIAN32__ */
   1.786 +
   1.787 +NPError     NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
   1.788 +
   1.789 +#ifndef __SYMBIAN32__
   1.790 +NPError     NPN_NewStream(NPP instance, NPMIMEType type,
   1.791 +                              const char* target, NPStream** stream);
   1.792 +#else/* __SYMBIAN32__ */
   1.793 +NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
   1.794 +                                const TDesC* target, NPStream** stream);
   1.795 +#endif /* __SYMBIAN32__ */
   1.796 +
   1.797 +int32   NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
   1.798 +NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
   1.799 +
   1.800 +#ifndef __SYMBIAN32__
   1.801 +void        NPN_Status(NPP instance, const char* message);
   1.802 +#else/* __SYMBIAN32__ */
   1.803 +void    NP_LOADDS NPN_Status(NPP instance, const TDesC& message);
   1.804 +#endif /* __SYMBIAN32__ */
   1.805 +
   1.806 +#ifndef __SYMBIAN32__
   1.807 +const char*    NPN_UserAgent(NPP instance);
   1.808 +#else/* __SYMBIAN32__ */
   1.809 +const TDesC* NP_LOADDS  NPN_UserAgent(NPP instance);
   1.810 +#endif /* __SYMBIAN32__ */
   1.811 +
   1.812 +
   1.813 +void*        NPN_MemAlloc(uint32 size);
   1.814 +void        NPN_MemFree(void* ptr);
   1.815 +uint32        NPN_MemFlush(uint32 size);
   1.816 +void        NPN_ReloadPlugins(NPBool reloadPages);
   1.817 +#ifndef __SYMBIAN32__
   1.818 +JRIEnv*     NPN_GetJavaEnv(void);
   1.819 +jref        NPN_GetJavaPeer(NPP instance);
   1.820 +#endif
   1.821 +NPError     NPN_GetValue(NPP instance, NPNVariable variable,
   1.822 +                             void *value);
   1.823 +NPError     NPN_SetValue(NPP instance, NPPVariable variable,
   1.824 +                             void *value);
   1.825 +void        NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
   1.826 +void        NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
   1.827 +void        NPN_ForceRedraw(NPP instance);
   1.828 +void        NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
   1.829 +void        NPN_PopPopupsEnabledState(NPP instance);
   1.830 +
   1.831 +#ifndef __SYMBIAN32__
   1.832 + #ifdef __cplusplus
   1.833 + }  /* end extern "C" */
   1.834 + #endif
   1.835 +#endif
   1.836 +
   1.837 +#endif /* _NPAPI_H_ */