📄 npapi.h
字号:
// // Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.// // This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 3 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA//#ifndef _NPAPI_H_#define _NPAPI_H_#ifdef __OS2__#pragma pack(1)#endif#include "prtypes.h"/* Copied from xp_core.h *//* removed #ifdef for hpux defined in /usr/include/model.h */#ifndef _INT16#define _INT16#endif#ifndef _INT32#define _INT32#endif#ifndef _UINT16#define _UINT16#endif#ifndef _UINT32#define _UINT32#endif/* * NO_NSPR_10_SUPPORT disables the inclusion * of obsolete/protypes.h, whose int16, uint16, * int32, and uint32 typedefs conflict with those * in this file. */ #ifndef NO_NSPR_10_SUPPORT#define NO_NSPR_10_SUPPORT#endif#ifdef OJI#include "jri.h" /* Java Runtime Interface */#endif#if defined (__OS2__ ) || defined (OS2)# ifndef XP_OS2# define XP_OS2 1# endif /* XP_OS2 */#endif /* __OS2__ */#ifdef _WINDOWS# include <windef.h># ifndef XP_WIN# define XP_WIN 1# endif /* XP_WIN */#endif /* _WINDOWS */#ifdef __MWERKS__# define _declspec __declspec# ifdef __INTEL__# undef NULL# ifndef XP_WIN# define XP_WIN 1# endif /* XP_WIN */# endif /* __INTEL__ */#endif /* __MWERKS__ */#ifdef XP_MACOSX#include <Carbon/Carbon.h>#ifdef __LP64__#define NP_NO_QUICKDRAW#endif#endif#if defined(XP_UNIX) # include <stdio.h># if defined(MOZ_X11)# include <X11/Xlib.h># include <X11/Xutil.h># endif#endif/*----------------------------------------------------------------------*//* Plugin Version Constants *//*----------------------------------------------------------------------*/#define NP_VERSION_MAJOR 0#define NP_VERSION_MINOR 19/* The OS/2 version of Netscape uses RC_DATA to define the mime types, file extensions, etc that are required. Use a vertical bar to separate types, end types with \0. FileVersion and ProductVersion are 32bit ints, all other entries are strings the MUST be terminated wwith a \0.AN EXAMPLE:RCDATA NP_INFO_ProductVersion { 1,0,0,1,}RCDATA NP_INFO_MIMEType { "video/x-video|", "video/x-flick\0" }RCDATA NP_INFO_FileExtents { "avi|", "flc\0" }RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|", "MMOS2 Flc/Fli player(*.flc)\0" }RCDATA NP_INFO_FileVersion { 1,0,0,1 }RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"RCDATA NP_INFO_InternalName { "NPAVI32\0" )RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }*//* RC_DATA types for version info - required */#define NP_INFO_ProductVersion 1#define NP_INFO_MIMEType 2#define NP_INFO_FileOpenName 3#define NP_INFO_FileExtents 4/* RC_DATA types for version info - used if found */#define NP_INFO_FileDescription 5#define NP_INFO_ProductName 6/* RC_DATA types for version info - optional */#define NP_INFO_CompanyName 7#define NP_INFO_FileVersion 8#define NP_INFO_InternalName 9#define NP_INFO_LegalCopyright 10#define NP_INFO_OriginalFilename 11#ifndef RC_INVOKED/*----------------------------------------------------------------------*//* Definition of Basic Types *//*----------------------------------------------------------------------*/#ifndef _UINT16typedef unsigned short uint16;#endif#ifndef _UINT32# if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)typedef unsigned int uint32;# else /* __alpha */typedef unsigned long uint32;# endif /* __alpha */#endif/* * AIX defines these in sys/inttypes.h included from sys/types.h */#ifndef AIX#ifndef _INT16typedef short int16;#endif#ifndef _INT32# if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)typedef int int32;# else /* __alpha */typedef long int32;# endif /* __alpha */#endif#endif#ifndef FALSE#define FALSE (0)#endif#ifndef TRUE#define TRUE (1)#endif#ifndef NULL#define NULL (0L)#endif#ifdef XP_MACOSXtypedef enum {#ifndef NP_NO_QUICKDRAW NPDrawingModelQuickDraw = 0,#endif NPDrawingModelCoreGraphics = 1} NPDrawingModel;#endiftypedef unsigned char NPBool;typedef int16 NPError;typedef int16 NPReason;typedef char* NPMIMEType;/*----------------------------------------------------------------------*//* Structures and definitions *//*----------------------------------------------------------------------*//* * NPP is a plug-in's opaque instance handle */typedef struct _NPP{ void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */} NPP_t;typedef NPP_t* NPP;typedef struct _NPStream{ void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */ const char* url; uint32 end; uint32 lastmodified; void* notifyData; const char* headers; /* Response headers from host. * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS. * Used for HTTP only; NULL for non-HTTP. * Available from NPP_NewStream onwards. * Plugin should copy this data before storing it. * Includes HTTP status line and all headers, * preferably verbatim as received from server, * headers formatted as in HTTP ("Header: Value"), * and newlines (\n, NOT \r\n) separating lines. * Terminated by \n\0 (NOT \n\n\0). */} NPStream;typedef struct _NPByteRange{ int32 offset; /* negative offset means from the end */ uint32 length; struct _NPByteRange* next;} NPByteRange;typedef struct _NPSavedData{ int32 len; void* buf;} NPSavedData;typedef struct _NPRect{ uint16 top; uint16 left; uint16 bottom; uint16 right;} NPRect;typedef struct _NPSize { int32 width; int32 height; } NPSize; #ifdef XP_UNIX/* * Unix specific structures and definitions *//* * Callback Structures. * * These are used to pass additional platform specific information. */enum { NP_SETWINDOW = 1, NP_PRINT};typedef struct{ int32 type;} NPAnyCallbackStruct;typedef struct{ int32 type;#ifdef MOZ_X11 Display* display; Visual* visual; Colormap colormap; unsigned int depth;#endif} NPSetWindowCallbackStruct;typedef struct{ int32 type; FILE* fp;} NPPrintCallbackStruct;#endif /* XP_UNIX *//* * The following masks are applied on certain platforms to NPNV and * NPPV selectors that pass around pointers to COM interfaces. Newer * compilers on some platforms may generate vtables that are not * compatible with older compilers. To prevent older plugins from * not understanding a new browser's ABI, these masks change the * values of those selectors on those platforms. To remain backwards * compatible with differenet versions of the browser, plugins can * use these masks to dynamically determine and use the correct C++ * ABI that the browser is expecting. This does not apply to Windows * as Microsoft's COM ABI will likely not change. */#define NP_ABI_GCC3_MASK 0x10000000/* * gcc 3.x generated vtables on UNIX and OSX are incompatible with * previous compilers. */#if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK#else#define _NP_ABI_MIXIN_FOR_GCC3 0#endif#define NP_ABI_MACHO_MASK 0x01000000/* * On OSX, the Mach-O executable format is significantly * different than CFM. In addition to having a different * C++ ABI, it also has has different C calling convention. * You must use glue code when calling between CFM and * Mach-O C functions. */#if (defined(TARGET_RT_MAC_MACHO))#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK#else#define _NP_ABI_MIXIN_FOR_MACHO 0#endif#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)/* * List of variable names for which NPP_GetValue shall be implemented */typedef enum { NPPVpluginNameString = 1, NPPVpluginDescriptionString, NPPVpluginWindowBool, NPPVpluginTransparentBool, NPPVjavaClass, /* Not implemented in Mozilla 1.0 */ NPPVpluginWindowSize, NPPVpluginTimerInterval, NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), NPPVpluginScriptableIID = 11,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -