|
21
|
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 |
|
|
4 |
* |
|
|
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/ |
|
|
9 |
* |
|
|
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 |
|
|
13 |
* License. |
|
|
14 |
* |
|
|
15 |
* The Original Code is mozilla.org code. |
|
|
16 |
* |
|
|
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. |
|
|
21 |
* |
|
|
22 |
* Contributor(s): |
|
|
23 |
* |
|
|
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. |
|
|
35 |
* |
|
|
36 |
* ***** END LICENSE BLOCK ***** */ |
|
|
37 |
|
|
|
38 |
|
|
|
39 |
/* |
|
|
40 |
* npapi.h $Revision: 3.48 $ |
|
|
41 |
* Netscape client plug-in API spec |
|
|
42 |
*/ |
|
|
43 |
|
|
|
44 |
#ifndef _NPAPI_H_ |
|
|
45 |
#define _NPAPI_H_ |
|
|
46 |
|
|
|
47 |
#ifdef __OS2__ |
|
|
48 |
#pragma pack(1) |
|
|
49 |
#endif |
|
|
50 |
|
|
|
51 |
#include "prtypes.h" |
|
|
52 |
/* Copied from xp_core.h */ |
|
|
53 |
/* removed #ifdef for hpux defined in /usr/include/model.h */ |
|
|
54 |
#ifndef _INT16 |
|
|
55 |
#define _INT16 |
|
|
56 |
#endif |
|
|
57 |
#ifndef _INT32 |
|
|
58 |
#define _INT32 |
|
|
59 |
#endif |
|
|
60 |
#ifndef _UINT16 |
|
|
61 |
#define _UINT16 |
|
|
62 |
#endif |
|
|
63 |
#ifndef _UINT32 |
|
|
64 |
#define _UINT32 |
|
|
65 |
#endif |
|
|
66 |
|
|
|
67 |
/* |
|
|
68 |
* NO_NSPR_10_SUPPORT disables the inclusion |
|
|
69 |
* of obsolete/protypes.h, whose int16, uint16, |
|
|
70 |
* int32, and uint32 typedefs conflict with those |
|
|
71 |
* in this file. |
|
|
72 |
*/ |
|
|
73 |
#ifndef NO_NSPR_10_SUPPORT |
|
|
74 |
#define NO_NSPR_10_SUPPORT |
|
|
75 |
#endif |
|
|
76 |
#ifdef OJI |
|
|
77 |
#include "jri.h" /* Java Runtime Interface */ |
|
|
78 |
#endif |
|
|
79 |
|
|
|
80 |
#if defined (__OS2__ ) || defined (OS2) |
|
|
81 |
# ifndef XP_OS2 |
|
|
82 |
# define XP_OS2 1 |
|
|
83 |
# endif /* XP_OS2 */ |
|
|
84 |
#endif /* __OS2__ */ |
|
|
85 |
|
|
|
86 |
#ifdef _WINDOWS |
|
|
87 |
# include <windef.h> |
|
|
88 |
# ifndef XP_WIN |
|
|
89 |
# define XP_WIN 1 |
|
|
90 |
# endif /* XP_WIN */ |
|
|
91 |
#endif /* _WINDOWS */ |
|
|
92 |
|
|
|
93 |
#ifdef __MWERKS__ |
|
|
94 |
# define _declspec __declspec |
|
|
95 |
# ifdef __INTEL__ |
|
|
96 |
# undef NULL |
|
|
97 |
# ifndef XP_WIN |
|
|
98 |
# define XP_WIN 1 |
|
|
99 |
# endif /* XP_WIN */ |
|
|
100 |
# endif /* __INTEL__ */ |
|
|
101 |
#endif /* __MWERKS__ */ |
|
|
102 |
|
|
|
103 |
#ifdef XP_MACOSX |
|
|
104 |
#include <Carbon/Carbon.h> |
|
|
105 |
#ifdef __LP64__ |
|
|
106 |
#define NP_NO_QUICKDRAW |
|
|
107 |
#endif |
|
|
108 |
#endif |
|
|
109 |
|
|
|
110 |
#if defined(XP_UNIX) |
|
|
111 |
# include <stdio.h> |
|
|
112 |
# if defined(MOZ_X11) |
|
|
113 |
# include <X11/Xlib.h> |
|
|
114 |
# include <X11/Xutil.h> |
|
|
115 |
# endif |
|
|
116 |
#endif |
|
|
117 |
|
|
|
118 |
/*----------------------------------------------------------------------*/ |
|
|
119 |
/* Plugin Version Constants */ |
|
|
120 |
/*----------------------------------------------------------------------*/ |
|
|
121 |
|
|
|
122 |
#define NP_VERSION_MAJOR 0 |
|
|
123 |
#define NP_VERSION_MINOR 19 |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
/* The OS/2 version of Netscape uses RC_DATA to define the |
|
|
127 |
mime types, file extensions, etc that are required. |
|
|
128 |
Use a vertical bar to separate types, end types with \0. |
|
|
129 |
FileVersion and ProductVersion are 32bit ints, all other |
|
|
130 |
entries are strings the MUST be terminated wwith a \0. |
|
|
131 |
|
|
|
132 |
AN EXAMPLE: |
|
|
133 |
|
|
|
134 |
RCDATA NP_INFO_ProductVersion { 1,0,0,1,} |
|
|
135 |
|
|
|
136 |
RCDATA NP_INFO_MIMEType { "video/x-video|", |
|
|
137 |
"video/x-flick\0" } |
|
|
138 |
RCDATA NP_INFO_FileExtents { "avi|", |
|
|
139 |
"flc\0" } |
|
|
140 |
RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|", |
|
|
141 |
"MMOS2 Flc/Fli player(*.flc)\0" } |
|
|
142 |
|
|
|
143 |
RCDATA NP_INFO_FileVersion { 1,0,0,1 } |
|
|
144 |
RCDATA NP_INFO_CompanyName { "Netscape Communications\0" } |
|
|
145 |
RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0" |
|
|
146 |
RCDATA NP_INFO_InternalName { "NPAVI32\0" ) |
|
|
147 |
RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0" |
|
|
148 |
RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" } |
|
|
149 |
RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" } |
|
|
150 |
|
|
|
151 |
*/ |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
/* RC_DATA types for version info - required */ |
|
|
155 |
#define NP_INFO_ProductVersion 1 |
|
|
156 |
#define NP_INFO_MIMEType 2 |
|
|
157 |
#define NP_INFO_FileOpenName 3 |
|
|
158 |
#define NP_INFO_FileExtents 4 |
|
|
159 |
|
|
|
160 |
/* RC_DATA types for version info - used if found */ |
|
|
161 |
#define NP_INFO_FileDescription 5 |
|
|
162 |
#define NP_INFO_ProductName 6 |
|
|
163 |
|
|
|
164 |
/* RC_DATA types for version info - optional */ |
|
|
165 |
#define NP_INFO_CompanyName 7 |
|
|
166 |
#define NP_INFO_FileVersion 8 |
|
|
167 |
#define NP_INFO_InternalName 9 |
|
|
168 |
#define NP_INFO_LegalCopyright 10 |
|
|
169 |
#define NP_INFO_OriginalFilename 11 |
|
|
170 |
|
|
|
171 |
#ifndef RC_INVOKED |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
/*----------------------------------------------------------------------*/ |
|
|
176 |
/* Definition of Basic Types */ |
|
|
177 |
/*----------------------------------------------------------------------*/ |
|
|
178 |
|
|
|
179 |
#ifndef _UINT16 |
|
|
180 |
typedef unsigned short uint16; |
|
|
181 |
#endif |
|
|
182 |
|
|
|
183 |
#ifndef _UINT32 |
|
|
184 |
# if defined(__alpha) || defined(__amd64__) || defined(__x86_64__) |
|
|
185 |
typedef unsigned int uint32; |
|
|
186 |
# else /* __alpha */ |
|
|
187 |
typedef unsigned long uint32; |
|
|
188 |
# endif /* __alpha */ |
|
|
189 |
#endif |
|
|
190 |
|
|
|
191 |
/* |
|
|
192 |
* AIX defines these in sys/inttypes.h included from sys/types.h |
|
|
193 |
*/ |
|
|
194 |
#ifndef AIX |
|
|
195 |
#ifndef _INT16 |
|
|
196 |
typedef short int16; |
|
|
197 |
#endif |
|
|
198 |
|
|
|
199 |
#ifndef _INT32 |
|
|
200 |
# if defined(__alpha) || defined(__amd64__) || defined(__x86_64__) |
|
|
201 |
typedef int int32; |
|
|
202 |
# else /* __alpha */ |
|
|
203 |
typedef long int32; |
|
|
204 |
# endif /* __alpha */ |
|
|
205 |
#endif |
|
|
206 |
#endif |
|
|
207 |
|
|
|
208 |
#ifndef FALSE |
|
|
209 |
#define FALSE (0) |
|
|
210 |
#endif |
|
|
211 |
#ifndef TRUE |
|
|
212 |
#define TRUE (1) |
|
|
213 |
#endif |
|
|
214 |
#ifndef NULL |
|
|
215 |
#define NULL (0L) |
|
|
216 |
#endif |
|
|
217 |
|
|
|
218 |
#ifdef XP_MACOSX |
|
|
219 |
typedef enum { |
|
|
220 |
#ifndef NP_NO_QUICKDRAW |
|
|
221 |
NPDrawingModelQuickDraw = 0, |
|
|
222 |
#endif |
|
|
223 |
NPDrawingModelCoreGraphics = 1 |
|
|
224 |
} NPDrawingModel; |
|
|
225 |
#endif |
|
|
226 |
|
|
|
227 |
typedef unsigned char NPBool; |
|
|
228 |
typedef int16 NPError; |
|
|
229 |
typedef int16 NPReason; |
|
|
230 |
typedef char* NPMIMEType; |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
|
|
|
234 |
/*----------------------------------------------------------------------*/ |
|
|
235 |
/* Structures and definitions */ |
|
|
236 |
/*----------------------------------------------------------------------*/ |
|
|
237 |
|
|
|
238 |
/* |
|
|
239 |
* NPP is a plug-in's opaque instance handle |
|
|
240 |
*/ |
|
|
241 |
typedef struct _NPP |
|
|
242 |
{ |
|
|
243 |
void* pdata; /* plug-in private data */ |
|
|
244 |
void* ndata; /* netscape private data */ |
|
|
245 |
} NPP_t; |
|
|
246 |
|
|
|
247 |
typedef NPP_t* NPP; |
|
|
248 |
|
|
|
249 |
|
|
|
250 |
typedef struct _NPStream |
|
|
251 |
{ |
|
|
252 |
void* pdata; /* plug-in private data */ |
|
|
253 |
void* ndata; /* netscape private data */ |
|
|
254 |
const char* url; |
|
|
255 |
uint32 end; |
|
|
256 |
uint32 lastmodified; |
|
|
257 |
void* notifyData; |
|
|
258 |
const char* headers; /* Response headers from host. |
|
|
259 |
* Exists only for >= NPVERS_HAS_RESPONSE_HEADERS. |
|
|
260 |
* Used for HTTP only; NULL for non-HTTP. |
|
|
261 |
* Available from NPP_NewStream onwards. |
|
|
262 |
* Plugin should copy this data before storing it. |
|
|
263 |
* Includes HTTP status line and all headers, |
|
|
264 |
* preferably verbatim as received from server, |
|
|
265 |
* headers formatted as in HTTP ("Header: Value"), |
|
|
266 |
* and newlines (\n, NOT \r\n) separating lines. |
|
|
267 |
* Terminated by \n\0 (NOT \n\n\0). */ |
|
|
268 |
} NPStream; |
|
|
269 |
|
|
|
270 |
|
|
|
271 |
typedef struct _NPByteRange |
|
|
272 |
{ |
|
|
273 |
int32 offset; /* negative offset means from the end */ |
|
|
274 |
uint32 length; |
|
|
275 |
struct _NPByteRange* next; |
|
|
276 |
} NPByteRange; |
|
|
277 |
|
|
|
278 |
|
|
|
279 |
typedef struct _NPSavedData |
|
|
280 |
{ |
|
|
281 |
int32 len; |
|
|
282 |
void* buf; |
|
|
283 |
} NPSavedData; |
|
|
284 |
|
|
|
285 |
|
|
|
286 |
typedef struct _NPRect |
|
|
287 |
{ |
|
|
288 |
uint16 top; |
|
|
289 |
uint16 left; |
|
|
290 |
uint16 bottom; |
|
|
291 |
uint16 right; |
|
|
292 |
} NPRect; |
|
|
293 |
|
|
|
294 |
typedef struct _NPSize |
|
|
295 |
{ |
|
|
296 |
int32 width; |
|
|
297 |
int32 height; |
|
|
298 |
} NPSize; |
|
|
299 |
|
|
|
300 |
#ifdef XP_UNIX |
|
|
301 |
/* |
|
|
302 |
* Unix specific structures and definitions |
|
|
303 |
*/ |
|
|
304 |
|
|
|
305 |
/* |
|
|
306 |
* Callback Structures. |
|
|
307 |
* |
|
|
308 |
* These are used to pass additional platform specific information. |
|
|
309 |
*/ |
|
|
310 |
enum { |
|
|
311 |
NP_SETWINDOW = 1, |
|
|
312 |
NP_PRINT |
|
|
313 |
}; |
|
|
314 |
|
|
|
315 |
typedef struct |
|
|
316 |
{ |
|
|
317 |
int32 type; |
|
|
318 |
} NPAnyCallbackStruct; |
|
|
319 |
|
|
|
320 |
typedef struct |
|
|
321 |
{ |
|
|
322 |
int32 type; |
|
|
323 |
#ifdef MOZ_X11 |
|
|
324 |
Display* display; |
|
|
325 |
Visual* visual; |
|
|
326 |
Colormap colormap; |
|
|
327 |
unsigned int depth; |
|
|
328 |
#endif |
|
|
329 |
} NPSetWindowCallbackStruct; |
|
|
330 |
|
|
|
331 |
typedef struct |
|
|
332 |
{ |
|
|
333 |
int32 type; |
|
|
334 |
FILE* fp; |
|
|
335 |
} NPPrintCallbackStruct; |
|
|
336 |
|
|
|
337 |
#endif /* XP_UNIX */ |
|
|
338 |
|
|
|
339 |
|
|
|
340 |
/* |
|
|
341 |
* The following masks are applied on certain platforms to NPNV and |
|
|
342 |
* NPPV selectors that pass around pointers to COM interfaces. Newer |
|
|
343 |
* compilers on some platforms may generate vtables that are not |
|
|
344 |
* compatible with older compilers. To prevent older plugins from |
|
|
345 |
* not understanding a new browser's ABI, these masks change the |
|
|
346 |
* values of those selectors on those platforms. To remain backwards |
|
|
347 |
* compatible with differenet versions of the browser, plugins can |
|
|
348 |
* use these masks to dynamically determine and use the correct C++ |
|
|
349 |
* ABI that the browser is expecting. This does not apply to Windows |
|
|
350 |
* as Microsoft's COM ABI will likely not change. |
|
|
351 |
*/ |
|
|
352 |
|
|
|
353 |
#define NP_ABI_GCC3_MASK 0x10000000 |
|
|
354 |
/* |
|
|
355 |
* gcc 3.x generated vtables on UNIX and OSX are incompatible with |
|
|
356 |
* previous compilers. |
|
|
357 |
*/ |
|
|
358 |
#if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) |
|
|
359 |
#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK |
|
|
360 |
#else |
|
|
361 |
#define _NP_ABI_MIXIN_FOR_GCC3 0 |
|
|
362 |
#endif |
|
|
363 |
|
|
|
364 |
|
|
|
365 |
#define NP_ABI_MACHO_MASK 0x01000000 |
|
|
366 |
/* |
|
|
367 |
* On OSX, the Mach-O executable format is significantly |
|
|
368 |
* different than CFM. In addition to having a different |
|
|
369 |
* C++ ABI, it also has has different C calling convention. |
|
|
370 |
* You must use glue code when calling between CFM and |
|
|
371 |
* Mach-O C functions. |
|
|
372 |
*/ |
|
|
373 |
#if (defined(TARGET_RT_MAC_MACHO)) |
|
|
374 |
#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK |
|
|
375 |
#else |
|
|
376 |
#define _NP_ABI_MIXIN_FOR_MACHO 0 |
|
|
377 |
#endif |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO) |
|
|
381 |
|
|
|
382 |
/* |
|
|
383 |
* List of variable names for which NPP_GetValue shall be implemented |
|
|
384 |
*/ |
|
|
385 |
typedef enum { |
|
|
386 |
NPPVpluginNameString = 1, |
|
|
387 |
NPPVpluginDescriptionString, |
|
|
388 |
NPPVpluginWindowBool, |
|
|
389 |
NPPVpluginTransparentBool, |
|
|
390 |
NPPVjavaClass, /* Not implemented in Mozilla 1.0 */ |
|
|
391 |
NPPVpluginWindowSize, |
|
|
392 |
NPPVpluginTimerInterval, |
|
|
393 |
|
|
|
394 |
NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), |
|
|
395 |
NPPVpluginScriptableIID = 11, |
|
|
396 |
|
|
|
397 |
/* Introduced in Mozilla 0.9.9 */ |
|
|
398 |
NPPVjavascriptPushCallerBool = 12, |
|
|
399 |
|
|
|
400 |
/* Introduced in Mozilla 1.0 */ |
|
|
401 |
NPPVpluginKeepLibraryInMemory = 13, |
|
|
402 |
NPPVpluginNeedsXEmbed = 14, |
|
|
403 |
|
|
|
404 |
/* Get the NPObject for scripting the plugin. Introduced in Firefox |
|
|
405 |
* 1.0 (NPAPI minor version 14). |
|
|
406 |
*/ |
|
|
407 |
NPPVpluginScriptableNPObject = 15, |
|
|
408 |
|
|
|
409 |
/* Get the plugin value (as \0-terminated UTF-8 string data) for |
|
|
410 |
* form submission if the plugin is part of a form. Use |
|
|
411 |
* NPN_MemAlloc() to allocate memory for the string data. Introduced |
|
|
412 |
* in Mozilla 1.8b2 (NPAPI minor version 15). |
|
|
413 |
*/ |
|
|
414 |
NPPVformValue = 16 |
|
|
415 |
#ifdef XP_MACOSX |
|
|
416 |
/* Used for negotiating drawing models */ |
|
|
417 |
, NPPVpluginDrawingModel = 1000 |
|
|
418 |
#endif |
|
|
419 |
} NPPVariable; |
|
|
420 |
|
|
|
421 |
/* |
|
|
422 |
* List of variable names for which NPN_GetValue is implemented by Mozilla |
|
|
423 |
*/ |
|
|
424 |
typedef enum { |
|
|
425 |
NPNVxDisplay = 1, |
|
|
426 |
NPNVxtAppContext, |
|
|
427 |
NPNVnetscapeWindow, |
|
|
428 |
NPNVjavascriptEnabledBool, |
|
|
429 |
NPNVasdEnabledBool, |
|
|
430 |
NPNVisOfflineBool, |
|
|
431 |
|
|
|
432 |
/* 10 and over are available on Mozilla builds starting with 0.9.4 */ |
|
|
433 |
NPNVserviceManager = (10 | NP_ABI_MASK), |
|
|
434 |
NPNVDOMElement = (11 | NP_ABI_MASK), /* available in Mozilla 1.2 */ |
|
|
435 |
NPNVDOMWindow = (12 | NP_ABI_MASK), |
|
|
436 |
NPNVToolkit = (13 | NP_ABI_MASK), |
|
|
437 |
NPNVSupportsXEmbedBool = 14, |
|
|
438 |
|
|
|
439 |
/* Get the NPObject wrapper for the browser window. */ |
|
|
440 |
NPNVWindowNPObject = 15, |
|
|
441 |
|
|
|
442 |
/* Get the NPObject wrapper for the plugins DOM element. */ |
|
|
443 |
NPNVPluginElementNPObject = 16, |
|
|
444 |
|
|
|
445 |
NPNVSupportsWindowless = 17 |
|
|
446 |
|
|
|
447 |
#ifdef XP_MACOSX |
|
|
448 |
/* Used for negotiating drawing models */ |
|
|
449 |
, NPNVpluginDrawingModel = 1000 |
|
|
450 |
#ifndef NP_NO_QUICKDRAW |
|
|
451 |
, NPNVsupportsQuickDrawBool = 2000 |
|
|
452 |
#endif |
|
|
453 |
, NPNVsupportsCoreGraphicsBool = 2001 |
|
|
454 |
#endif |
|
|
455 |
} NPNVariable; |
|
|
456 |
|
|
|
457 |
/* |
|
|
458 |
* The type of Tookkit the widgets use |
|
|
459 |
*/ |
|
|
460 |
typedef enum { |
|
|
461 |
NPNVGtk12 = 1, |
|
|
462 |
NPNVGtk2 |
|
|
463 |
} NPNToolkitType; |
|
|
464 |
|
|
|
465 |
/* |
|
|
466 |
* The type of a NPWindow - it specifies the type of the data structure |
|
|
467 |
* returned in the window field. |
|
|
468 |
*/ |
|
|
469 |
typedef enum { |
|
|
470 |
NPWindowTypeWindow = 1, |
|
|
471 |
NPWindowTypeDrawable |
|
|
472 |
} NPWindowType; |
|
|
473 |
|
|
|
474 |
typedef struct _NPWindow |
|
|
475 |
{ |
|
|
476 |
void* window; /* Platform specific window handle */ |
|
|
477 |
/* OS/2: x - Position of bottom left corner */ |
|
|
478 |
/* OS/2: y - relative to visible netscape window */ |
|
|
479 |
int32 x; /* Position of top left corner relative */ |
|
|
480 |
int32 y; /* to a netscape page. */ |
|
|
481 |
uint32 width; /* Maximum window size */ |
|
|
482 |
uint32 height; |
|
|
483 |
NPRect clipRect; /* Clipping rectangle in port coordinates */ |
|
|
484 |
/* Used by MAC only. */ |
|
|
485 |
#if defined(XP_UNIX) && !defined(XP_MACOSX) |
|
|
486 |
void * ws_info; /* Platform-dependent additonal data */ |
|
|
487 |
#endif /* XP_UNIX */ |
|
|
488 |
NPWindowType type; /* Is this a window or a drawable? */ |
|
|
489 |
} NPWindow; |
|
|
490 |
|
|
|
491 |
|
|
|
492 |
typedef struct _NPFullPrint |
|
|
493 |
{ |
|
|
494 |
NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */ |
|
|
495 |
NPBool printOne; /* TRUE if plugin should print one copy to default printer */ |
|
|
496 |
void* platformPrint; /* Platform-specific printing info */ |
|
|
497 |
} NPFullPrint; |
|
|
498 |
|
|
|
499 |
typedef struct _NPEmbedPrint |
|
|
500 |
{ |
|
|
501 |
NPWindow window; |
|
|
502 |
void* platformPrint; /* Platform-specific printing info */ |
|
|
503 |
} NPEmbedPrint; |
|
|
504 |
|
|
|
505 |
typedef struct _NPPrint |
|
|
506 |
{ |
|
|
507 |
uint16 mode; /* NP_FULL or NP_EMBED */ |
|
|
508 |
union |
|
|
509 |
{ |
|
|
510 |
NPFullPrint fullPrint; /* if mode is NP_FULL */ |
|
|
511 |
NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ |
|
|
512 |
} print; |
|
|
513 |
} NPPrint; |
|
|
514 |
|
|
|
515 |
#ifdef XP_MACOSX |
|
|
516 |
typedef EventRecord NPEvent; |
|
|
517 |
#elif defined(XP_WIN) |
|
|
518 |
typedef struct _NPEvent |
|
|
519 |
{ |
|
|
520 |
uint16 event; |
|
|
521 |
uint32 wParam; |
|
|
522 |
uint32 lParam; |
|
|
523 |
} NPEvent; |
|
|
524 |
#elif defined(XP_OS2) |
|
|
525 |
typedef struct _NPEvent |
|
|
526 |
{ |
|
|
527 |
uint32 event; |
|
|
528 |
uint32 wParam; |
|
|
529 |
uint32 lParam; |
|
|
530 |
} NPEvent; |
|
|
531 |
#elif defined (XP_UNIX) && defined(MOZ_X11) |
|
|
532 |
typedef XEvent NPEvent; |
|
|
533 |
#else |
|
|
534 |
typedef void* NPEvent; |
|
|
535 |
#endif /* XP_MACOSX */ |
|
|
536 |
|
|
|
537 |
#ifdef XP_MACOSX |
|
|
538 |
typedef void* NPRegion; |
|
|
539 |
#ifndef NP_NO_QUICKDRAW |
|
|
540 |
typedef RgnHandle NPQDRegion; |
|
|
541 |
#endif |
|
|
542 |
typedef CGPathRef NPCGRegion; |
|
|
543 |
#elif defined(XP_WIN) |
|
|
544 |
typedef HRGN NPRegion; |
|
|
545 |
#elif defined(XP_UNIX) && defined(MOZ_X11) |
|
|
546 |
typedef Region NPRegion; |
|
|
547 |
#else |
|
|
548 |
typedef void *NPRegion; |
|
|
549 |
#endif /* XP_MACOSX */ |
|
|
550 |
|
|
|
551 |
#ifdef XP_MACOSX |
|
|
552 |
/* |
|
|
553 |
* Mac-specific structures and definitions. |
|
|
554 |
*/ |
|
|
555 |
|
|
|
556 |
typedef struct NP_Port |
|
|
557 |
{ |
|
|
558 |
CGrafPtr port; /* Grafport */ |
|
|
559 |
int32 portx; /* position inside the topmost window */ |
|
|
560 |
int32 porty; |
|
|
561 |
} NP_Port; |
|
|
562 |
|
|
|
563 |
typedef struct NP_CGContext |
|
|
564 |
{ |
|
|
565 |
CGContextRef context; |
|
|
566 |
WindowRef window; |
|
|
567 |
} NP_CGContext; |
|
|
568 |
|
|
|
569 |
/* |
|
|
570 |
* Non-standard event types that can be passed to HandleEvent |
|
|
571 |
*/ |
|
|
572 |
|
|
|
573 |
enum NPEventType { |
|
|
574 |
NPEventType_GetFocusEvent = (osEvt + 16), |
|
|
575 |
NPEventType_LoseFocusEvent, |
|
|
576 |
NPEventType_AdjustCursorEvent, |
|
|
577 |
NPEventType_MenuCommandEvent, |
|
|
578 |
NPEventType_ClippingChangedEvent, |
|
|
579 |
NPEventType_ScrollingBeginsEvent = 1000, |
|
|
580 |
NPEventType_ScrollingEndsEvent |
|
|
581 |
}; |
|
|
582 |
|
|
|
583 |
#ifdef OBSOLETE |
|
|
584 |
#define getFocusEvent (osEvt + 16) |
|
|
585 |
#define loseFocusEvent (osEvt + 17) |
|
|
586 |
#define adjustCursorEvent (osEvt + 18) |
|
|
587 |
#endif |
|
|
588 |
#endif /* XP_MACOSX */ |
|
|
589 |
|
|
|
590 |
/* |
|
|
591 |
* Values for mode passed to NPP_New: |
|
|
592 |
*/ |
|
|
593 |
#define NP_EMBED 1 |
|
|
594 |
#define NP_FULL 2 |
|
|
595 |
|
|
|
596 |
/* |
|
|
597 |
* Values for stream type passed to NPP_NewStream: |
|
|
598 |
*/ |
|
|
599 |
#define NP_NORMAL 1 |
|
|
600 |
#define NP_SEEK 2 |
|
|
601 |
#define NP_ASFILE 3 |
|
|
602 |
#define NP_ASFILEONLY 4 |
|
|
603 |
|
|
|
604 |
#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) |
|
|
605 |
|
|
|
606 |
|
|
|
607 |
/*----------------------------------------------------------------------*/ |
|
|
608 |
/* Error and Reason Code definitions */ |
|
|
609 |
/*----------------------------------------------------------------------*/ |
|
|
610 |
|
|
|
611 |
/* |
|
|
612 |
* Values of type NPError: |
|
|
613 |
*/ |
|
|
614 |
#define NPERR_BASE 0 |
|
|
615 |
#define NPERR_NO_ERROR (NPERR_BASE + 0) |
|
|
616 |
#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) |
|
|
617 |
#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) |
|
|
618 |
#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) |
|
|
619 |
#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) |
|
|
620 |
#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) |
|
|
621 |
#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) |
|
|
622 |
#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) |
|
|
623 |
#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) |
|
|
624 |
#define NPERR_INVALID_PARAM (NPERR_BASE + 9) |
|
|
625 |
#define NPERR_INVALID_URL (NPERR_BASE + 10) |
|
|
626 |
#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) |
|
|
627 |
#define NPERR_NO_DATA (NPERR_BASE + 12) |
|
|
628 |
#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) |
|
|
629 |
|
|
|
630 |
/* |
|
|
631 |
* Values of type NPReason: |
|
|
632 |
*/ |
|
|
633 |
#define NPRES_BASE 0 |
|
|
634 |
#define NPRES_DONE (NPRES_BASE + 0) |
|
|
635 |
#define NPRES_NETWORK_ERR (NPRES_BASE + 1) |
|
|
636 |
#define NPRES_USER_BREAK (NPRES_BASE + 2) |
|
|
637 |
|
|
|
638 |
/* |
|
|
639 |
* Don't use these obsolete error codes any more. |
|
|
640 |
*/ |
|
|
641 |
#define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR |
|
|
642 |
#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR |
|
|
643 |
#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK |
|
|
644 |
|
|
|
645 |
/* |
|
|
646 |
* Version feature information |
|
|
647 |
*/ |
|
|
648 |
#define NPVERS_HAS_STREAMOUTPUT 8 |
|
|
649 |
#define NPVERS_HAS_NOTIFICATION 9 |
|
|
650 |
#define NPVERS_HAS_LIVECONNECT 9 |
|
|
651 |
#define NPVERS_WIN16_HAS_LIVECONNECT 9 |
|
|
652 |
#define NPVERS_68K_HAS_LIVECONNECT 11 |
|
|
653 |
#define NPVERS_HAS_WINDOWLESS 11 |
|
|
654 |
#define NPVERS_HAS_XPCONNECT_SCRIPTING 13 |
|
|
655 |
#define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 |
|
|
656 |
#define NPVERS_HAS_FORM_VALUES 15 |
|
|
657 |
#define NPVERS_HAS_POPUPS_ENABLED_STATE 16 |
|
|
658 |
#define NPVERS_HAS_RESPONSE_HEADERS 17 |
|
|
659 |
#define NPVERS_HAS_NPOBJECT_ENUM 18 |
|
|
660 |
#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19 |
|
|
661 |
|
|
|
662 |
/*----------------------------------------------------------------------*/ |
|
|
663 |
/* Function Prototypes */ |
|
|
664 |
/*----------------------------------------------------------------------*/ |
|
|
665 |
|
|
|
666 |
#if defined(_WINDOWS) && !defined(WIN32) |
|
|
667 |
#define NP_LOADDS _loadds |
|
|
668 |
#else |
|
|
669 |
#if defined(__OS2__) |
|
|
670 |
#define NP_LOADDS _System |
|
|
671 |
#else |
|
|
672 |
#define NP_LOADDS |
|
|
673 |
#endif |
|
|
674 |
#endif |
|
|
675 |
|
|
|
676 |
#ifdef __cplusplus |
|
|
677 |
extern "C" { |
|
|
678 |
#endif |
|
|
679 |
|
|
|
680 |
/* |
|
|
681 |
* NPP_* functions are provided by the plugin and called by the navigator. |
|
|
682 |
*/ |
|
|
683 |
|
|
|
684 |
#ifdef XP_UNIX |
|
|
685 |
char* NPP_GetMIMEDescription(void); |
|
|
686 |
#endif /* XP_UNIX */ |
|
|
687 |
|
|
|
688 |
NPError NP_LOADDS NPP_Initialize(void); |
|
|
689 |
void NP_LOADDS NPP_Shutdown(void); |
|
|
690 |
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, |
|
|
691 |
uint16 mode, int16 argc, char* argn[], |
|
|
692 |
char* argv[], NPSavedData* saved); |
|
|
693 |
NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); |
|
|
694 |
NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); |
|
|
695 |
NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, |
|
|
696 |
NPStream* stream, NPBool seekable, |
|
|
697 |
uint16* stype); |
|
|
698 |
NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, |
|
|
699 |
NPReason reason); |
|
|
700 |
int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); |
|
|
701 |
int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, |
|
|
702 |
int32 len, void* buffer); |
|
|
703 |
void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, |
|
|
704 |
const char* fname); |
|
|
705 |
void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); |
|
|
706 |
int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event); |
|
|
707 |
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, |
|
|
708 |
NPReason reason, void* notifyData); |
|
|
709 |
#ifdef OJI |
|
|
710 |
jref NP_LOADDS NPP_GetJavaClass(void); |
|
|
711 |
#endif |
|
|
712 |
NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value); |
|
|
713 |
NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value); |
|
|
714 |
|
|
|
715 |
/* |
|
|
716 |
* NPN_* functions are provided by the navigator and called by the plugin. |
|
|
717 |
*/ |
|
|
718 |
void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor, |
|
|
719 |
int* netscape_major, int* netscape_minor); |
|
|
720 |
NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url, |
|
|
721 |
const char* target, void* notifyData); |
|
|
722 |
NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url, |
|
|
723 |
const char* target); |
|
|
724 |
NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url, |
|
|
725 |
const char* target, uint32 len, |
|
|
726 |
const char* buf, NPBool file, |
|
|
727 |
void* notifyData); |
|
|
728 |
NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url, |
|
|
729 |
const char* target, uint32 len, |
|
|
730 |
const char* buf, NPBool file); |
|
|
731 |
NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); |
|
|
732 |
NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, |
|
|
733 |
const char* target, NPStream** stream); |
|
|
734 |
int32 NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer); |
|
|
735 |
NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason); |
|
|
736 |
void NP_LOADDS NPN_Status(NPP instance, const char* message); |
|
|
737 |
const char* NP_LOADDS NPN_UserAgent(NPP instance); |
|
|
738 |
void* NP_LOADDS NPN_MemAlloc(uint32 size); |
|
|
739 |
void NP_LOADDS NPN_MemFree(void* ptr); |
|
|
740 |
uint32 NP_LOADDS NPN_MemFlush(uint32 size); |
|
|
741 |
void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages); |
|
|
742 |
#ifdef OJI |
|
|
743 |
JRIEnv* NP_LOADDS NPN_GetJavaEnv(void); |
|
|
744 |
jref NP_LOADDS NPN_GetJavaPeer(NPP instance); |
|
|
745 |
#endif |
|
|
746 |
NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value); |
|
|
747 |
NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value); |
|
|
748 |
void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect); |
|
|
749 |
void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion); |
|
|
750 |
void NP_LOADDS NPN_ForceRedraw(NPP instance); |
|
|
751 |
void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled); |
|
|
752 |
void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance); |
|
|
753 |
void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance, |
|
|
754 |
void (*func) (void *), |
|
|
755 |
void *userData); |
|
|
756 |
|
|
|
757 |
#ifdef __cplusplus |
|
|
758 |
} /* end extern "C" */ |
|
|
759 |
#endif |
|
|
760 |
|
|
|
761 |
#endif /* RC_INVOKED */ |
|
|
762 |
#ifdef __OS2__ |
|
|
763 |
#pragma pack() |
|
|
764 |
#endif |
|
|
765 |
|
|
|
766 |
#endif /* _NPAPI_H_ */ |