| 1 |
// npapidefs.h |
| 2 |
// minimal version of the defs from the NS plugin SDK |
| 3 |
|
| 4 |
#ifndef NPAPIDEFS_H |
| 5 |
#define NPAPIDEFS_H |
| 6 |
|
| 7 |
#define NP_VERSION_MAJOR 0 |
| 8 |
#define NP_VERSION_MINOR 11 |
| 9 |
|
| 10 |
#define NPVERS_HAS_STREAMOUTPUT 8 |
| 11 |
#define NPVERS_HAS_NOTIFICATION 9 |
| 12 |
#define NPVERS_HAS_LIVECONNECT 9 |
| 13 |
#define NPVERS_HAS_WINDOWLESS 11 |
| 14 |
|
| 15 |
#define NPERR_NO_ERROR 0 |
| 16 |
#define NPERR_GENERIC_ERROR 1 |
| 17 |
#define NPERR_INVALID_INSTANCE_ERROR 2 |
| 18 |
#define NPERR_INVALID_FUNCTABLE_ERROR 3 |
| 19 |
#define NPERR_MODULE_LOAD_FAILED_ERROR 4 |
| 20 |
#define NPERR_OUT_OF_MEMORY_ERROR 5 |
| 21 |
#define NPERR_INVALID_PLUGIN_ERROR 6 |
| 22 |
#define NPERR_INVALID_PLUGIN_DIR_ERROR 7 |
| 23 |
#define NPERR_INCOMPATIBLE_VERSION_ERROR 8 |
| 24 |
#define NPERR_INVALID_PARAM 9 |
| 25 |
#define NPERR_INVALID_URL 10 |
| 26 |
#define NPERR_FILE_NOT_FOUND 11 |
| 27 |
#define NPERR_NO_DATA 12 |
| 28 |
#define NPERR_STREAM_NOT_SEEKABLE 13 |
| 29 |
|
| 30 |
#define NP_EMBED 1 |
| 31 |
#define NP_FULL 2 |
| 32 |
|
| 33 |
#define NP_NORMAL 1 |
| 34 |
#define NP_SEEK 2 |
| 35 |
#define NP_ASFILE 3 |
| 36 |
#define NP_ASFILEONLY 4 |
| 37 |
|
| 38 |
#define NPRES_DONE 0 |
| 39 |
#define NPRES_NETWORK_ERR 1 |
| 40 |
#define NPRES_USER_BREAK 2 |
| 41 |
|
| 42 |
typedef unsigned short uint16; |
| 43 |
typedef unsigned long uint32; |
| 44 |
typedef short int16; |
| 45 |
typedef long int32; |
| 46 |
|
| 47 |
typedef unsigned char NPBool; |
| 48 |
typedef int16 NPError; |
| 49 |
typedef int16 NPReason; |
| 50 |
typedef char* NPMIMEType; |
| 51 |
typedef HRGN NPRegion; |
| 52 |
|
| 53 |
typedef void* JRIGlobalRef; |
| 54 |
struct JRIEnvInterface; |
| 55 |
typedef struct JRIEnvInterface JRIEnvInterface; |
| 56 |
typedef const JRIEnvInterface* JRIEnv; |
| 57 |
struct _jobject; |
| 58 |
typedef struct _jobject *jobject; |
| 59 |
typedef jobject jref; |
| 60 |
|
| 61 |
typedef struct _NPRect |
| 62 |
{ |
| 63 |
uint16 top; |
| 64 |
uint16 left; |
| 65 |
uint16 bottom; |
| 66 |
uint16 right; |
| 67 |
} NPRect; |
| 68 |
|
| 69 |
typedef struct _NPP |
| 70 |
{ |
| 71 |
void* pdata; |
| 72 |
void* ndata; |
| 73 |
} NPP_t; |
| 74 |
|
| 75 |
typedef NPP_t* NPP; |
| 76 |
|
| 77 |
typedef struct _NPStream |
| 78 |
{ |
| 79 |
void* pdata; |
| 80 |
void* ndata; |
| 81 |
const char* url; |
| 82 |
uint32 end; |
| 83 |
uint32 lastmodified; |
| 84 |
void* notifyData; |
| 85 |
} NPStream; |
| 86 |
|
| 87 |
typedef enum { |
| 88 |
NPPVpluginNameString = 1, |
| 89 |
NPPVpluginDescriptionString, |
| 90 |
NPPVpluginWindowBool, |
| 91 |
NPPVpluginTransparentBool |
| 92 |
} NPPVariable; |
| 93 |
|
| 94 |
typedef enum { |
| 95 |
NPNVxDisplay = 1, |
| 96 |
NPNVxtAppContext, |
| 97 |
NPNVnetscapeWindow, |
| 98 |
NPNVjavascriptEnabledBool, |
| 99 |
NPNVasdEnabledBool, |
| 100 |
NPNVisOfflineBool |
| 101 |
} NPNVariable; |
| 102 |
|
| 103 |
typedef enum { |
| 104 |
NPWindowTypeWindow = 1, |
| 105 |
NPWindowTypeDrawable |
| 106 |
} NPWindowType; |
| 107 |
|
| 108 |
typedef struct _NPSavedData |
| 109 |
{ |
| 110 |
int32 len; |
| 111 |
void* buf; |
| 112 |
} NPSavedData; |
| 113 |
|
| 114 |
typedef struct _NPByteRange |
| 115 |
{ |
| 116 |
int32 offset; |
| 117 |
uint32 length; |
| 118 |
struct _NPByteRange* next; |
| 119 |
} NPByteRange; |
| 120 |
|
| 121 |
typedef struct _NPFullPrint |
| 122 |
{ |
| 123 |
NPBool pluginPrinted; |
| 124 |
NPBool printOne; |
| 125 |
void* platformPrint; |
| 126 |
} NPFullPrint; |
| 127 |
|
| 128 |
typedef struct _NPWindow |
| 129 |
{ |
| 130 |
void* window; |
| 131 |
int32 x; |
| 132 |
int32 y; |
| 133 |
uint32 width; |
| 134 |
uint32 height; |
| 135 |
NPRect clipRect; |
| 136 |
NPWindowType type; |
| 137 |
} NPWindow; |
| 138 |
|
| 139 |
typedef struct _NPEmbedPrint |
| 140 |
{ |
| 141 |
NPWindow window; |
| 142 |
void* platformPrint; |
| 143 |
} NPEmbedPrint; |
| 144 |
|
| 145 |
typedef struct _NPPrint |
| 146 |
{ |
| 147 |
uint16 mode; |
| 148 |
union |
| 149 |
{ |
| 150 |
NPFullPrint fullPrint; |
| 151 |
NPEmbedPrint embedPrint; |
| 152 |
} print; |
| 153 |
} NPPrint; |
| 154 |
|
| 155 |
typedef struct _NPEvent |
| 156 |
{ |
| 157 |
uint16 event; |
| 158 |
uint32 wParam; |
| 159 |
uint32 lParam; |
| 160 |
} NPEvent; |
| 161 |
|
| 162 |
|
| 163 |
typedef NPError (*NPP_NewUPP)(NPMIMEType,NPP,uint16,int16,char* argn[],char* argv[],NPSavedData*); |
| 164 |
typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save); |
| 165 |
typedef NPError (*NPP_SetWindowUPP)(NPP,NPWindow*); |
| 166 |
typedef NPError (*NPP_NewStreamUPP)(NPP,NPMIMEType,NPStream*,NPBool,uint16*); |
| 167 |
typedef NPError (*NPP_DestroyStreamUPP)(NPP,NPStream*,NPReason); |
| 168 |
typedef int32 (*NPP_WriteReadyUPP)(NPP instance,NPStream*); |
| 169 |
typedef int32 (*NPP_WriteUPP)(NPP,NPStream*,int32,int32,void*); |
| 170 |
typedef void (*NPP_StreamAsFileUPP)(NPP,NPStream*,const char*); |
| 171 |
typedef void (*NPP_PrintUPP)(NPP,NPPrint*); |
| 172 |
typedef int16 (*NPP_HandleEventUPP)(NPP,void*); |
| 173 |
typedef void (*NPP_URLNotifyUPP)(NPP,const char*,NPReason,void*); |
| 174 |
typedef NPError (*NPP_GetValueUPP)(NPP,NPPVariable,void*); |
| 175 |
typedef NPError (*NPP_SetValueUPP)(NPP,NPNVariable,void*); |
| 176 |
typedef NPError (*NPN_GetValueUPP)(NPP,NPNVariable,void*); |
| 177 |
typedef NPError (*NPN_SetValueUPP)(NPP,NPPVariable,void*); |
| 178 |
typedef NPError (*NPN_GetURLNotifyUPP)(NPP,const char*,const char*,void*); |
| 179 |
typedef NPError (*NPN_PostURLNotifyUPP)(NPP,const char*,const char*,uint32,const char*,NPBool,void*); |
| 180 |
typedef NPError (*NPN_GetURLUPP)(NPP,const char*,const char*); |
| 181 |
typedef NPError (*NPN_PostURLUPP)(NPP,const char*,const char*,uint32,const char*,NPBool); |
| 182 |
typedef NPError (*NPN_RequestReadUPP)(NPStream*,NPByteRange*); |
| 183 |
typedef NPError (*NPN_NewStreamUPP)(NPP,NPMIMEType,const char*,NPStream**); |
| 184 |
typedef int32 (*NPN_WriteUPP)(NPP,NPStream*,int32,void*); |
| 185 |
typedef NPError (*NPN_DestroyStreamUPP)(NPP,NPStream*,NPReason); |
| 186 |
typedef void (*NPN_StatusUPP)(NPP instance, const char*); |
| 187 |
typedef const char* (*NPN_UserAgentUPP)(NPP); |
| 188 |
typedef void* (*NPN_MemAllocUPP)(uint32); |
| 189 |
typedef void (*NPN_MemFreeUPP)(void*); |
| 190 |
typedef uint32 (*NPN_MemFlushUPP)(uint32); |
| 191 |
typedef void (*NPN_ReloadPluginsUPP)(NPBool); |
| 192 |
typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void); |
| 193 |
typedef jref (*NPN_GetJavaPeerUPP)(NPP); |
| 194 |
typedef void (*NPN_InvalidateRectUPP)(NPP,NPRect*); |
| 195 |
typedef void (*NPN_InvalidateRegionUPP)(NPP,NPRegion); |
| 196 |
typedef void (*NPN_ForceRedrawUPP)(NPP); |
| 197 |
|
| 198 |
|
| 199 |
typedef struct _NPPluginFuncs { |
| 200 |
uint16 size; |
| 201 |
uint16 version; |
| 202 |
NPP_NewUPP newp; |
| 203 |
NPP_DestroyUPP destroy; |
| 204 |
NPP_SetWindowUPP setwindow; |
| 205 |
NPP_NewStreamUPP newstream; |
| 206 |
NPP_DestroyStreamUPP destroystream; |
| 207 |
NPP_StreamAsFileUPP asfile; |
| 208 |
NPP_WriteReadyUPP writeready; |
| 209 |
NPP_WriteUPP write; |
| 210 |
NPP_PrintUPP print; |
| 211 |
NPP_HandleEventUPP event; |
| 212 |
NPP_URLNotifyUPP urlnotify; |
| 213 |
JRIGlobalRef javaClass; |
| 214 |
NPP_GetValueUPP getvalue; |
| 215 |
NPP_SetValueUPP setvalue; |
| 216 |
} NPPluginFuncs; |
| 217 |
|
| 218 |
typedef struct _NPNetscapeFuncs { |
| 219 |
uint16 size; |
| 220 |
uint16 version; |
| 221 |
NPN_GetURLUPP geturl; |
| 222 |
NPN_PostURLUPP posturl; |
| 223 |
NPN_RequestReadUPP requestread; |
| 224 |
NPN_NewStreamUPP newstream; |
| 225 |
NPN_WriteUPP write; |
| 226 |
NPN_DestroyStreamUPP destroystream; |
| 227 |
NPN_StatusUPP status; |
| 228 |
NPN_UserAgentUPP uagent; |
| 229 |
NPN_MemAllocUPP memalloc; |
| 230 |
NPN_MemFreeUPP memfree; |
| 231 |
NPN_MemFlushUPP memflush; |
| 232 |
NPN_ReloadPluginsUPP reloadplugins; |
| 233 |
NPN_GetJavaEnvUPP getJavaEnv; |
| 234 |
NPN_GetJavaPeerUPP getJavaPeer; |
| 235 |
NPN_GetURLNotifyUPP geturlnotify; |
| 236 |
NPN_PostURLNotifyUPP posturlnotify; |
| 237 |
NPN_GetValueUPP getvalue; |
| 238 |
NPN_SetValueUPP setvalue; |
| 239 |
NPN_InvalidateRectUPP invalidaterect; |
| 240 |
NPN_InvalidateRegionUPP invalidateregion; |
| 241 |
NPN_ForceRedrawUPP forceredraw; |
| 242 |
} NPNetscapeFuncs; |
| 243 |
|
| 244 |
|
| 245 |
#endif // NPAPIDEFS_H |