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 | #ifndef npapi_h_
|
---|
39 | #define npapi_h_
|
---|
40 |
|
---|
41 | #ifndef RC_INVOKED
|
---|
42 |
|
---|
43 | #if defined(__OS2__)
|
---|
44 | #pragma pack(1)
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | #include "nptypes.h"
|
---|
48 |
|
---|
49 | #if defined(__OS2__) || defined(OS2)
|
---|
50 | #ifndef XP_OS2
|
---|
51 | #define XP_OS2 1
|
---|
52 | #endif
|
---|
53 | #endif
|
---|
54 |
|
---|
55 | #if defined(_WIN32) && !defined(__SYMBIAN32__)
|
---|
56 | #include <windef.h>
|
---|
57 | #ifndef XP_WIN
|
---|
58 | #define XP_WIN 1
|
---|
59 | #endif
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | #if defined(__SYMBIAN32__)
|
---|
63 | #ifndef XP_SYMBIAN
|
---|
64 | #define XP_SYMBIAN 1
|
---|
65 | #undef XP_WIN
|
---|
66 | #endif
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | #if defined(__APPLE_CC__) && !defined(XP_UNIX)
|
---|
70 | #ifndef XP_MACOSX
|
---|
71 | #define XP_MACOSX 1
|
---|
72 | #endif
|
---|
73 | #endif
|
---|
74 |
|
---|
75 | #if defined(XP_MACOSX) && defined(__LP64__)
|
---|
76 | #define NP_NO_QUICKDRAW
|
---|
77 | #define NP_NO_CARBON
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | #if defined(XP_MACOSX)
|
---|
81 | #include <ApplicationServices/ApplicationServices.h>
|
---|
82 | #include <OpenGL/OpenGL.h>
|
---|
83 | #ifndef NP_NO_CARBON
|
---|
84 | #include <Carbon/Carbon.h>
|
---|
85 | #endif
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #if defined(XP_UNIX)
|
---|
89 | #include <stdio.h>
|
---|
90 | #if defined(MOZ_X11)
|
---|
91 | #include <X11/Xlib.h>
|
---|
92 | #include <X11/Xutil.h>
|
---|
93 | #endif
|
---|
94 | #endif
|
---|
95 |
|
---|
96 | #if defined(XP_SYMBIAN)
|
---|
97 | #include <QEvent>
|
---|
98 | #include <QRegion>
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | #endif /* RC_INVOKED */
|
---|
102 |
|
---|
103 | /*----------------------------------------------------------------------*/
|
---|
104 | /* Plugin Version Constants */
|
---|
105 | /*----------------------------------------------------------------------*/
|
---|
106 |
|
---|
107 | #define NP_VERSION_MAJOR 0
|
---|
108 | #define NP_VERSION_MINOR 27
|
---|
109 |
|
---|
110 |
|
---|
111 | /* The OS/2 version of Netscape uses RC_DATA to define the
|
---|
112 | mime types, file extensions, etc that are required.
|
---|
113 | Use a vertical bar to separate types, end types with \0.
|
---|
114 | FileVersion and ProductVersion are 32bit ints, all other
|
---|
115 | entries are strings that MUST be terminated with a \0.
|
---|
116 |
|
---|
117 | AN EXAMPLE:
|
---|
118 |
|
---|
119 | RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
|
---|
120 |
|
---|
121 | RCDATA NP_INFO_MIMEType { "video/x-video|",
|
---|
122 | "video/x-flick\0" }
|
---|
123 | RCDATA NP_INFO_FileExtents { "avi|",
|
---|
124 | "flc\0" }
|
---|
125 | RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
|
---|
126 | "MMOS2 Flc/Fli player(*.flc)\0" }
|
---|
127 |
|
---|
128 | RCDATA NP_INFO_FileVersion { 1,0,0,1 }
|
---|
129 | RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
|
---|
130 | RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
|
---|
131 | RCDATA NP_INFO_InternalName { "NPAVI32\0" )
|
---|
132 | RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
|
---|
133 | RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
|
---|
134 | RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
|
---|
135 | */
|
---|
136 | /* RC_DATA types for version info - required */
|
---|
137 | #define NP_INFO_ProductVersion 1
|
---|
138 | #define NP_INFO_MIMEType 2
|
---|
139 | #define NP_INFO_FileOpenName 3
|
---|
140 | #define NP_INFO_FileExtents 4
|
---|
141 | /* RC_DATA types for version info - used if found */
|
---|
142 | #define NP_INFO_FileDescription 5
|
---|
143 | #define NP_INFO_ProductName 6
|
---|
144 | /* RC_DATA types for version info - optional */
|
---|
145 | #define NP_INFO_CompanyName 7
|
---|
146 | #define NP_INFO_FileVersion 8
|
---|
147 | #define NP_INFO_InternalName 9
|
---|
148 | #define NP_INFO_LegalCopyright 10
|
---|
149 | #define NP_INFO_OriginalFilename 11
|
---|
150 |
|
---|
151 | #ifndef RC_INVOKED
|
---|
152 |
|
---|
153 | /*----------------------------------------------------------------------*/
|
---|
154 | /* Definition of Basic Types */
|
---|
155 | /*----------------------------------------------------------------------*/
|
---|
156 |
|
---|
157 | typedef unsigned char NPBool;
|
---|
158 | typedef int16_t NPError;
|
---|
159 | typedef int16_t NPReason;
|
---|
160 | typedef char* NPMIMEType;
|
---|
161 |
|
---|
162 | /*----------------------------------------------------------------------*/
|
---|
163 | /* Structures and definitions */
|
---|
164 | /*----------------------------------------------------------------------*/
|
---|
165 |
|
---|
166 | #if !defined(__LP64__)
|
---|
167 | #if defined(XP_MACOSX)
|
---|
168 | #pragma options align=mac68k
|
---|
169 | #endif
|
---|
170 | #endif /* __LP64__ */
|
---|
171 |
|
---|
172 | /*
|
---|
173 | * NPP is a plug-in's opaque instance handle
|
---|
174 | */
|
---|
175 | typedef struct _NPP
|
---|
176 | {
|
---|
177 | void* pdata; /* plug-in private data */
|
---|
178 | void* ndata; /* netscape private data */
|
---|
179 | } NPP_t;
|
---|
180 |
|
---|
181 | typedef NPP_t* NPP;
|
---|
182 |
|
---|
183 | typedef struct _NPStream
|
---|
184 | {
|
---|
185 | void* pdata; /* plug-in private data */
|
---|
186 | void* ndata; /* netscape private data */
|
---|
187 | const char* url;
|
---|
188 | uint32_t end;
|
---|
189 | uint32_t lastmodified;
|
---|
190 | void* notifyData;
|
---|
191 | const char* headers; /* Response headers from host.
|
---|
192 | * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
|
---|
193 | * Used for HTTP only; NULL for non-HTTP.
|
---|
194 | * Available from NPP_NewStream onwards.
|
---|
195 | * Plugin should copy this data before storing it.
|
---|
196 | * Includes HTTP status line and all headers,
|
---|
197 | * preferably verbatim as received from server,
|
---|
198 | * headers formatted as in HTTP ("Header: Value"),
|
---|
199 | * and newlines (\n, NOT \r\n) separating lines.
|
---|
200 | * Terminated by \n\0 (NOT \n\n\0). */
|
---|
201 | } NPStream;
|
---|
202 |
|
---|
203 | typedef struct _NPByteRange
|
---|
204 | {
|
---|
205 | int32_t offset; /* negative offset means from the end */
|
---|
206 | uint32_t length;
|
---|
207 | struct _NPByteRange* next;
|
---|
208 | } NPByteRange;
|
---|
209 |
|
---|
210 | typedef struct _NPSavedData
|
---|
211 | {
|
---|
212 | int32_t len;
|
---|
213 | void* buf;
|
---|
214 | } NPSavedData;
|
---|
215 |
|
---|
216 | typedef struct _NPRect
|
---|
217 | {
|
---|
218 | uint16_t top;
|
---|
219 | uint16_t left;
|
---|
220 | uint16_t bottom;
|
---|
221 | uint16_t right;
|
---|
222 | } NPRect;
|
---|
223 |
|
---|
224 | typedef struct _NPSize
|
---|
225 | {
|
---|
226 | int32_t width;
|
---|
227 | int32_t height;
|
---|
228 | } NPSize;
|
---|
229 |
|
---|
230 | typedef enum {
|
---|
231 | NPFocusNext = 0,
|
---|
232 | NPFocusPrevious = 1
|
---|
233 | } NPFocusDirection;
|
---|
234 |
|
---|
235 | /* Return values for NPP_HandleEvent */
|
---|
236 | #define kNPEventNotHandled 0
|
---|
237 | #define kNPEventHandled 1
|
---|
238 | /* Exact meaning must be spec'd in event model. */
|
---|
239 | #define kNPEventStartIME 2
|
---|
240 |
|
---|
241 | #if defined(XP_UNIX)
|
---|
242 | /*
|
---|
243 | * Unix specific structures and definitions
|
---|
244 | */
|
---|
245 |
|
---|
246 | /*
|
---|
247 | * Callback Structures.
|
---|
248 | *
|
---|
249 | * These are used to pass additional platform specific information.
|
---|
250 | */
|
---|
251 | enum {
|
---|
252 | NP_SETWINDOW = 1,
|
---|
253 | NP_PRINT
|
---|
254 | };
|
---|
255 |
|
---|
256 | typedef struct
|
---|
257 | {
|
---|
258 | int32_t type;
|
---|
259 | } NPAnyCallbackStruct;
|
---|
260 |
|
---|
261 | typedef struct
|
---|
262 | {
|
---|
263 | int32_t type;
|
---|
264 | #if defined(MOZ_X11)
|
---|
265 | Display* display;
|
---|
266 | Visual* visual;
|
---|
267 | Colormap colormap;
|
---|
268 | unsigned int depth;
|
---|
269 | #endif
|
---|
270 | } NPSetWindowCallbackStruct;
|
---|
271 |
|
---|
272 | typedef struct
|
---|
273 | {
|
---|
274 | int32_t type;
|
---|
275 | FILE* fp;
|
---|
276 | } NPPrintCallbackStruct;
|
---|
277 |
|
---|
278 | #endif /* XP_UNIX */
|
---|
279 |
|
---|
280 | #if defined(XP_MACOSX)
|
---|
281 | typedef enum {
|
---|
282 | #ifndef NP_NO_QUICKDRAW
|
---|
283 | NPDrawingModelQuickDraw = 0,
|
---|
284 | #endif
|
---|
285 | NPDrawingModelCoreGraphics = 1,
|
---|
286 | NPDrawingModelOpenGL = 2,
|
---|
287 | NPDrawingModelCoreAnimation = 3,
|
---|
288 | NPDrawingModelInvalidatingCoreAnimation = 4
|
---|
289 | } NPDrawingModel;
|
---|
290 |
|
---|
291 | typedef enum {
|
---|
292 | #ifndef NP_NO_CARBON
|
---|
293 | NPEventModelCarbon = 0,
|
---|
294 | #endif
|
---|
295 | NPEventModelCocoa = 1
|
---|
296 | } NPEventModel;
|
---|
297 | #endif
|
---|
298 |
|
---|
299 | /*
|
---|
300 | * The following masks are applied on certain platforms to NPNV and
|
---|
301 | * NPPV selectors that pass around pointers to COM interfaces. Newer
|
---|
302 | * compilers on some platforms may generate vtables that are not
|
---|
303 | * compatible with older compilers. To prevent older plugins from
|
---|
304 | * not understanding a new browser's ABI, these masks change the
|
---|
305 | * values of those selectors on those platforms. To remain backwards
|
---|
306 | * compatible with different versions of the browser, plugins can
|
---|
307 | * use these masks to dynamically determine and use the correct C++
|
---|
308 | * ABI that the browser is expecting. This does not apply to Windows
|
---|
309 | * as Microsoft's COM ABI will likely not change.
|
---|
310 | */
|
---|
311 |
|
---|
312 | #define NP_ABI_GCC3_MASK 0x10000000
|
---|
313 | /*
|
---|
314 | * gcc 3.x generated vtables on UNIX and OSX are incompatible with
|
---|
315 | * previous compilers.
|
---|
316 | */
|
---|
317 | #if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
|
---|
318 | #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
|
---|
319 | #else
|
---|
320 | #define _NP_ABI_MIXIN_FOR_GCC3 0
|
---|
321 | #endif
|
---|
322 |
|
---|
323 | #if defined(XP_MACOSX)
|
---|
324 | #define NP_ABI_MACHO_MASK 0x01000000
|
---|
325 | #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
|
---|
326 | #else
|
---|
327 | #define _NP_ABI_MIXIN_FOR_MACHO 0
|
---|
328 | #endif
|
---|
329 |
|
---|
330 | #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
|
---|
331 |
|
---|
332 | /*
|
---|
333 | * List of variable names for which NPP_GetValue shall be implemented
|
---|
334 | */
|
---|
335 | typedef enum {
|
---|
336 | NPPVpluginNameString = 1,
|
---|
337 | NPPVpluginDescriptionString,
|
---|
338 | NPPVpluginWindowBool,
|
---|
339 | NPPVpluginTransparentBool,
|
---|
340 | NPPVjavaClass,
|
---|
341 | NPPVpluginWindowSize,
|
---|
342 | NPPVpluginTimerInterval,
|
---|
343 | NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
|
---|
344 | NPPVpluginScriptableIID = 11,
|
---|
345 | NPPVjavascriptPushCallerBool = 12,
|
---|
346 | NPPVpluginKeepLibraryInMemory = 13,
|
---|
347 | NPPVpluginNeedsXEmbed = 14,
|
---|
348 |
|
---|
349 | /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
|
---|
350 | */
|
---|
351 | NPPVpluginScriptableNPObject = 15,
|
---|
352 |
|
---|
353 | /* Get the plugin value (as \0-terminated UTF-8 string data) for
|
---|
354 | * form submission if the plugin is part of a form. Use
|
---|
355 | * NPN_MemAlloc() to allocate memory for the string data. Introduced
|
---|
356 | * in NPAPI minor version 15.
|
---|
357 | */
|
---|
358 | NPPVformValue = 16,
|
---|
359 |
|
---|
360 | NPPVpluginUrlRequestsDisplayedBool = 17,
|
---|
361 |
|
---|
362 | /* Checks if the plugin is interested in receiving the http body of
|
---|
363 | * all http requests (including failed ones, http status != 200).
|
---|
364 | */
|
---|
365 | NPPVpluginWantsAllNetworkStreams = 18,
|
---|
366 |
|
---|
367 | /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
|
---|
368 | NPPVpluginNativeAccessibleAtkPlugId = 19,
|
---|
369 |
|
---|
370 | /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
|
---|
371 | NPPVpluginCancelSrcStream = 20,
|
---|
372 |
|
---|
373 | NPPVsupportsAdvancedKeyHandling = 21,
|
---|
374 |
|
---|
375 | NPPVpluginUsesDOMForCursorBool = 22
|
---|
376 |
|
---|
377 | #if defined(XP_MACOSX)
|
---|
378 | /* Used for negotiating drawing models */
|
---|
379 | , NPPVpluginDrawingModel = 1000
|
---|
380 | /* Used for negotiating event models */
|
---|
381 | , NPPVpluginEventModel = 1001
|
---|
382 | /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
|
---|
383 | , NPPVpluginCoreAnimationLayer = 1003
|
---|
384 | #endif
|
---|
385 |
|
---|
386 | #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
|
---|
387 | , NPPVpluginWindowlessLocalBool = 2002
|
---|
388 | #endif
|
---|
389 | } NPPVariable;
|
---|
390 |
|
---|
391 | /*
|
---|
392 | * List of variable names for which NPN_GetValue should be implemented.
|
---|
393 | */
|
---|
394 | typedef enum {
|
---|
395 | NPNVxDisplay = 1,
|
---|
396 | NPNVxtAppContext,
|
---|
397 | NPNVnetscapeWindow,
|
---|
398 | NPNVjavascriptEnabledBool,
|
---|
399 | NPNVasdEnabledBool,
|
---|
400 | NPNVisOfflineBool,
|
---|
401 |
|
---|
402 | NPNVserviceManager = (10 | NP_ABI_MASK),
|
---|
403 | NPNVDOMElement = (11 | NP_ABI_MASK),
|
---|
404 | NPNVDOMWindow = (12 | NP_ABI_MASK),
|
---|
405 | NPNVToolkit = (13 | NP_ABI_MASK),
|
---|
406 | NPNVSupportsXEmbedBool = 14,
|
---|
407 |
|
---|
408 | /* Get the NPObject wrapper for the browser window. */
|
---|
409 | NPNVWindowNPObject = 15,
|
---|
410 |
|
---|
411 | /* Get the NPObject wrapper for the plugins DOM element. */
|
---|
412 | NPNVPluginElementNPObject = 16,
|
---|
413 |
|
---|
414 | NPNVSupportsWindowless = 17,
|
---|
415 |
|
---|
416 | NPNVprivateModeBool = 18,
|
---|
417 |
|
---|
418 | NPNVsupportsAdvancedKeyHandling = 21,
|
---|
419 |
|
---|
420 | NPNVdocumentOrigin = 22
|
---|
421 |
|
---|
422 | #if defined(XP_MACOSX)
|
---|
423 | /* Used for negotiating drawing models */
|
---|
424 | , NPNVpluginDrawingModel = 1000
|
---|
425 | #ifndef NP_NO_QUICKDRAW
|
---|
426 | , NPNVsupportsQuickDrawBool = 2000
|
---|
427 | #endif
|
---|
428 | , NPNVsupportsCoreGraphicsBool = 2001
|
---|
429 | , NPNVsupportsOpenGLBool = 2002
|
---|
430 | , NPNVsupportsCoreAnimationBool = 2003
|
---|
431 | , NPNVsupportsInvalidatingCoreAnimationBool = 2004
|
---|
432 | #ifndef NP_NO_CARBON
|
---|
433 | , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
|
---|
434 | #endif
|
---|
435 | , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
|
---|
436 | , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
|
---|
437 | Cocoa text input specification. */
|
---|
438 | , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
|
---|
439 | CA model compositing */
|
---|
440 | #endif
|
---|
441 | #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
|
---|
442 | , NPNVSupportsWindowlessLocal = 2002
|
---|
443 | #endif
|
---|
444 | } NPNVariable;
|
---|
445 |
|
---|
446 | typedef enum {
|
---|
447 | NPNURLVCookie = 501,
|
---|
448 | NPNURLVProxy
|
---|
449 | } NPNURLVariable;
|
---|
450 |
|
---|
451 | /*
|
---|
452 | * The type of Toolkit the widgets use
|
---|
453 | */
|
---|
454 | typedef enum {
|
---|
455 | NPNVGtk12 = 1,
|
---|
456 | NPNVGtk2
|
---|
457 | } NPNToolkitType;
|
---|
458 |
|
---|
459 | /*
|
---|
460 | * The type of a NPWindow - it specifies the type of the data structure
|
---|
461 | * returned in the window field.
|
---|
462 | */
|
---|
463 | typedef enum {
|
---|
464 | NPWindowTypeWindow = 1,
|
---|
465 | NPWindowTypeDrawable
|
---|
466 | } NPWindowType;
|
---|
467 |
|
---|
468 | typedef struct _NPWindow
|
---|
469 | {
|
---|
470 | void* window; /* Platform specific window handle */
|
---|
471 | /* OS/2: x - Position of bottom left corner */
|
---|
472 | /* OS/2: y - relative to visible netscape window */
|
---|
473 | int32_t x; /* Position of top left corner relative */
|
---|
474 | int32_t y; /* to a netscape page. */
|
---|
475 | uint32_t width; /* Maximum window size */
|
---|
476 | uint32_t height;
|
---|
477 | NPRect clipRect; /* Clipping rectangle in port coordinates */
|
---|
478 | #if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
|
---|
479 | void * ws_info; /* Platform-dependent additional data */
|
---|
480 | #endif /* XP_UNIX */
|
---|
481 | NPWindowType type; /* Is this a window or a drawable? */
|
---|
482 | } NPWindow;
|
---|
483 |
|
---|
484 | typedef struct _NPImageExpose
|
---|
485 | {
|
---|
486 | char* data; /* image pointer */
|
---|
487 | int32_t stride; /* Stride of data image pointer */
|
---|
488 | int32_t depth; /* Depth of image pointer */
|
---|
489 | int32_t x; /* Expose x */
|
---|
490 | int32_t y; /* Expose y */
|
---|
491 | uint32_t width; /* Expose width */
|
---|
492 | uint32_t height; /* Expose height */
|
---|
493 | NPSize dataSize; /* Data buffer size */
|
---|
494 | float translateX; /* translate X matrix value */
|
---|
495 | float translateY; /* translate Y matrix value */
|
---|
496 | float scaleX; /* scale X matrix value */
|
---|
497 | float scaleY; /* scale Y matrix value */
|
---|
498 | } NPImageExpose;
|
---|
499 |
|
---|
500 | typedef struct _NPFullPrint
|
---|
501 | {
|
---|
502 | NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
|
---|
503 | NPBool printOne; /* TRUE if plugin should print one copy to default
|
---|
504 | printer */
|
---|
505 | void* platformPrint; /* Platform-specific printing info */
|
---|
506 | } NPFullPrint;
|
---|
507 |
|
---|
508 | typedef struct _NPEmbedPrint
|
---|
509 | {
|
---|
510 | NPWindow window;
|
---|
511 | void* platformPrint; /* Platform-specific printing info */
|
---|
512 | } NPEmbedPrint;
|
---|
513 |
|
---|
514 | typedef struct _NPPrint
|
---|
515 | {
|
---|
516 | uint16_t mode; /* NP_FULL or NP_EMBED */
|
---|
517 | union
|
---|
518 | {
|
---|
519 | NPFullPrint fullPrint; /* if mode is NP_FULL */
|
---|
520 | NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
|
---|
521 | } print;
|
---|
522 | } NPPrint;
|
---|
523 |
|
---|
524 | #if defined(XP_MACOSX)
|
---|
525 | #ifndef NP_NO_CARBON
|
---|
526 | typedef EventRecord NPEvent;
|
---|
527 | #endif
|
---|
528 | #elif defined(XP_SYMBIAN)
|
---|
529 | typedef QEvent NPEvent;
|
---|
530 | #elif defined(XP_WIN)
|
---|
531 | typedef struct _NPEvent
|
---|
532 | {
|
---|
533 | uint16_t event;
|
---|
534 | uintptr_t wParam;
|
---|
535 | uintptr_t lParam;
|
---|
536 | } NPEvent;
|
---|
537 | #elif defined(XP_OS2)
|
---|
538 | typedef struct _NPEvent
|
---|
539 | {
|
---|
540 | uint32_t event;
|
---|
541 | uint32_t wParam;
|
---|
542 | uint32_t lParam;
|
---|
543 | } NPEvent;
|
---|
544 | #elif defined(XP_UNIX) && defined(MOZ_X11)
|
---|
545 | typedef XEvent NPEvent;
|
---|
546 | #else
|
---|
547 | typedef void* NPEvent;
|
---|
548 | #endif
|
---|
549 |
|
---|
550 | #if defined(XP_MACOSX)
|
---|
551 | typedef void* NPRegion;
|
---|
552 | #ifndef NP_NO_QUICKDRAW
|
---|
553 | typedef RgnHandle NPQDRegion;
|
---|
554 | #endif
|
---|
555 | typedef CGPathRef NPCGRegion;
|
---|
556 | #elif defined(XP_WIN)
|
---|
557 | typedef HRGN NPRegion;
|
---|
558 | #elif defined(XP_UNIX) && defined(MOZ_X11)
|
---|
559 | typedef Region NPRegion;
|
---|
560 | #elif defined(XP_SYMBIAN)
|
---|
561 | typedef QRegion* NPRegion;
|
---|
562 | #else
|
---|
563 | typedef void *NPRegion;
|
---|
564 | #endif
|
---|
565 |
|
---|
566 | typedef struct _NPNSString NPNSString;
|
---|
567 | typedef struct _NPNSWindow NPNSWindow;
|
---|
568 | typedef struct _NPNSMenu NPNSMenu;
|
---|
569 |
|
---|
570 | #if defined(XP_MACOSX)
|
---|
571 | typedef NPNSMenu NPMenu;
|
---|
572 | #else
|
---|
573 | typedef void *NPMenu;
|
---|
574 | #endif
|
---|
575 |
|
---|
576 | typedef enum {
|
---|
577 | NPCoordinateSpacePlugin = 1,
|
---|
578 | NPCoordinateSpaceWindow,
|
---|
579 | NPCoordinateSpaceFlippedWindow,
|
---|
580 | NPCoordinateSpaceScreen,
|
---|
581 | NPCoordinateSpaceFlippedScreen
|
---|
582 | } NPCoordinateSpace;
|
---|
583 |
|
---|
584 | #if defined(XP_MACOSX)
|
---|
585 |
|
---|
586 | #ifndef NP_NO_QUICKDRAW
|
---|
587 | typedef struct NP_Port
|
---|
588 | {
|
---|
589 | CGrafPtr port;
|
---|
590 | int32_t portx; /* position inside the topmost window */
|
---|
591 | int32_t porty;
|
---|
592 | } NP_Port;
|
---|
593 | #endif /* NP_NO_QUICKDRAW */
|
---|
594 |
|
---|
595 | /*
|
---|
596 | * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
|
---|
597 | * as its drawing model.
|
---|
598 | */
|
---|
599 |
|
---|
600 | typedef struct NP_CGContext
|
---|
601 | {
|
---|
602 | CGContextRef context;
|
---|
603 | void *window; /* A WindowRef under the Carbon event model. */
|
---|
604 | } NP_CGContext;
|
---|
605 |
|
---|
606 | /*
|
---|
607 | * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
|
---|
608 | * drawing model.
|
---|
609 | */
|
---|
610 |
|
---|
611 | typedef struct NP_GLContext
|
---|
612 | {
|
---|
613 | CGLContextObj context;
|
---|
614 | #ifdef NP_NO_CARBON
|
---|
615 | NPNSWindow *window;
|
---|
616 | #else
|
---|
617 | void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
|
---|
618 | #endif
|
---|
619 | } NP_GLContext;
|
---|
620 |
|
---|
621 | typedef enum {
|
---|
622 | NPCocoaEventDrawRect = 1,
|
---|
623 | NPCocoaEventMouseDown,
|
---|
624 | NPCocoaEventMouseUp,
|
---|
625 | NPCocoaEventMouseMoved,
|
---|
626 | NPCocoaEventMouseEntered,
|
---|
627 | NPCocoaEventMouseExited,
|
---|
628 | NPCocoaEventMouseDragged,
|
---|
629 | NPCocoaEventKeyDown,
|
---|
630 | NPCocoaEventKeyUp,
|
---|
631 | NPCocoaEventFlagsChanged,
|
---|
632 | NPCocoaEventFocusChanged,
|
---|
633 | NPCocoaEventWindowFocusChanged,
|
---|
634 | NPCocoaEventScrollWheel,
|
---|
635 | NPCocoaEventTextInput
|
---|
636 | } NPCocoaEventType;
|
---|
637 |
|
---|
638 | typedef struct _NPCocoaEvent {
|
---|
639 | NPCocoaEventType type;
|
---|
640 | uint32_t version;
|
---|
641 | union {
|
---|
642 | struct {
|
---|
643 | uint32_t modifierFlags;
|
---|
644 | double pluginX;
|
---|
645 | double pluginY;
|
---|
646 | int32_t buttonNumber;
|
---|
647 | int32_t clickCount;
|
---|
648 | double deltaX;
|
---|
649 | double deltaY;
|
---|
650 | double deltaZ;
|
---|
651 | } mouse;
|
---|
652 | struct {
|
---|
653 | uint32_t modifierFlags;
|
---|
654 | NPNSString *characters;
|
---|
655 | NPNSString *charactersIgnoringModifiers;
|
---|
656 | NPBool isARepeat;
|
---|
657 | uint16_t keyCode;
|
---|
658 | } key;
|
---|
659 | struct {
|
---|
660 | CGContextRef context;
|
---|
661 | double x;
|
---|
662 | double y;
|
---|
663 | double width;
|
---|
664 | double height;
|
---|
665 | } draw;
|
---|
666 | struct {
|
---|
667 | NPBool hasFocus;
|
---|
668 | } focus;
|
---|
669 | struct {
|
---|
670 | NPNSString *text;
|
---|
671 | } text;
|
---|
672 | } data;
|
---|
673 | } NPCocoaEvent;
|
---|
674 |
|
---|
675 | #ifndef NP_NO_CARBON
|
---|
676 | /* Non-standard event types that can be passed to HandleEvent */
|
---|
677 | enum NPEventType {
|
---|
678 | NPEventType_GetFocusEvent = (osEvt + 16),
|
---|
679 | NPEventType_LoseFocusEvent,
|
---|
680 | NPEventType_AdjustCursorEvent,
|
---|
681 | NPEventType_MenuCommandEvent,
|
---|
682 | NPEventType_ClippingChangedEvent,
|
---|
683 | NPEventType_ScrollingBeginsEvent = 1000,
|
---|
684 | NPEventType_ScrollingEndsEvent
|
---|
685 | };
|
---|
686 | #endif /* NP_NO_CARBON */
|
---|
687 |
|
---|
688 | #endif /* XP_MACOSX */
|
---|
689 |
|
---|
690 | /*
|
---|
691 | * Values for mode passed to NPP_New:
|
---|
692 | */
|
---|
693 | #define NP_EMBED 1
|
---|
694 | #define NP_FULL 2
|
---|
695 |
|
---|
696 | /*
|
---|
697 | * Values for stream type passed to NPP_NewStream:
|
---|
698 | */
|
---|
699 | #define NP_NORMAL 1
|
---|
700 | #define NP_SEEK 2
|
---|
701 | #define NP_ASFILE 3
|
---|
702 | #define NP_ASFILEONLY 4
|
---|
703 |
|
---|
704 | #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
|
---|
705 |
|
---|
706 | /*
|
---|
707 | * Flags for NPP_ClearSiteData.
|
---|
708 | */
|
---|
709 | #define NP_CLEAR_ALL 0
|
---|
710 | #define NP_CLEAR_CACHE (1 << 0)
|
---|
711 |
|
---|
712 | #if !defined(__LP64__)
|
---|
713 | #if defined(XP_MACOSX)
|
---|
714 | #pragma options align=reset
|
---|
715 | #endif
|
---|
716 | #endif /* __LP64__ */
|
---|
717 |
|
---|
718 | /*----------------------------------------------------------------------*/
|
---|
719 | /* Error and Reason Code definitions */
|
---|
720 | /*----------------------------------------------------------------------*/
|
---|
721 |
|
---|
722 | /*
|
---|
723 | * Values of type NPError:
|
---|
724 | */
|
---|
725 | #define NPERR_BASE 0
|
---|
726 | #define NPERR_NO_ERROR (NPERR_BASE + 0)
|
---|
727 | #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
|
---|
728 | #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
|
---|
729 | #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
|
---|
730 | #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
|
---|
731 | #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
|
---|
732 | #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
|
---|
733 | #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
|
---|
734 | #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
|
---|
735 | #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
|
---|
736 | #define NPERR_INVALID_URL (NPERR_BASE + 10)
|
---|
737 | #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
|
---|
738 | #define NPERR_NO_DATA (NPERR_BASE + 12)
|
---|
739 | #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
|
---|
740 | #define NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)
|
---|
741 | #define NPERR_MALFORMED_SITE (NPERR_BASE + 15)
|
---|
742 |
|
---|
743 | /*
|
---|
744 | * Values of type NPReason:
|
---|
745 | */
|
---|
746 | #define NPRES_BASE 0
|
---|
747 | #define NPRES_DONE (NPRES_BASE + 0)
|
---|
748 | #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
|
---|
749 | #define NPRES_USER_BREAK (NPRES_BASE + 2)
|
---|
750 |
|
---|
751 | /*
|
---|
752 | * Don't use these obsolete error codes any more.
|
---|
753 | */
|
---|
754 | #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
|
---|
755 | #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
|
---|
756 | #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
|
---|
757 |
|
---|
758 | /*
|
---|
759 | * Version feature information
|
---|
760 | */
|
---|
761 | #define NPVERS_HAS_STREAMOUTPUT 8
|
---|
762 | #define NPVERS_HAS_NOTIFICATION 9
|
---|
763 | #define NPVERS_HAS_LIVECONNECT 9
|
---|
764 | #define NPVERS_68K_HAS_LIVECONNECT 11
|
---|
765 | #define NPVERS_HAS_WINDOWLESS 11
|
---|
766 | #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
|
---|
767 | #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
|
---|
768 | #define NPVERS_HAS_FORM_VALUES 15
|
---|
769 | #define NPVERS_HAS_POPUPS_ENABLED_STATE 16
|
---|
770 | #define NPVERS_HAS_RESPONSE_HEADERS 17
|
---|
771 | #define NPVERS_HAS_NPOBJECT_ENUM 18
|
---|
772 | #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
|
---|
773 | #define NPVERS_HAS_ALL_NETWORK_STREAMS 20
|
---|
774 | #define NPVERS_HAS_URL_AND_AUTH_INFO 21
|
---|
775 | #define NPVERS_HAS_PRIVATE_MODE 22
|
---|
776 | #define NPVERS_MACOSX_HAS_COCOA_EVENTS 23
|
---|
777 | #define NPVERS_HAS_ADVANCED_KEY_HANDLING 25
|
---|
778 | #define NPVERS_HAS_URL_REDIRECT_HANDLING 26
|
---|
779 | #define NPVERS_HAS_CLEAR_SITE_DATA 27
|
---|
780 |
|
---|
781 | /*----------------------------------------------------------------------*/
|
---|
782 | /* Function Prototypes */
|
---|
783 | /*----------------------------------------------------------------------*/
|
---|
784 |
|
---|
785 | #if defined(__OS2__)
|
---|
786 | #define NP_LOADDS _System
|
---|
787 | #else
|
---|
788 | #define NP_LOADDS
|
---|
789 | #endif
|
---|
790 |
|
---|
791 | #ifdef __cplusplus
|
---|
792 | extern "C" {
|
---|
793 | #endif
|
---|
794 |
|
---|
795 | /* NPP_* functions are provided by the plugin and called by the navigator. */
|
---|
796 |
|
---|
797 | #if defined(XP_UNIX)
|
---|
798 | const char* NPP_GetMIMEDescription(void);
|
---|
799 | #endif
|
---|
800 |
|
---|
801 | NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
|
---|
802 | uint16_t mode, int16_t argc, char* argn[],
|
---|
803 | char* argv[], NPSavedData* saved);
|
---|
804 | NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
|
---|
805 | NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
|
---|
806 | NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
|
---|
807 | NPStream* stream, NPBool seekable,
|
---|
808 | uint16_t* stype);
|
---|
809 | NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
|
---|
810 | NPReason reason);
|
---|
811 | int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
|
---|
812 | int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
|
---|
813 | int32_t len, void* buffer);
|
---|
814 | void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
|
---|
815 | const char* fname);
|
---|
816 | void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
|
---|
817 | int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
|
---|
818 | void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
|
---|
819 | NPReason reason, void* notifyData);
|
---|
820 | NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
|
---|
821 | NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
|
---|
822 | NPBool NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
|
---|
823 | void NP_LOADDS NPP_LostFocus(NPP instance);
|
---|
824 | void NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);
|
---|
825 | NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge);
|
---|
826 | char** NP_LOADDS NPP_GetSitesWithData(void);
|
---|
827 |
|
---|
828 | /* NPN_* functions are provided by the navigator and called by the plugin. */
|
---|
829 | void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
|
---|
830 | int* netscape_major, int* netscape_minor);
|
---|
831 | NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
|
---|
832 | const char* target, void* notifyData);
|
---|
833 | NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
|
---|
834 | const char* target);
|
---|
835 | NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
|
---|
836 | const char* target, uint32_t len,
|
---|
837 | const char* buf, NPBool file,
|
---|
838 | void* notifyData);
|
---|
839 | NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
|
---|
840 | const char* target, uint32_t len,
|
---|
841 | const char* buf, NPBool file);
|
---|
842 | NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
|
---|
843 | NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
|
---|
844 | const char* target, NPStream** stream);
|
---|
845 | int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
|
---|
846 | void* buffer);
|
---|
847 | NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream,
|
---|
848 | NPReason reason);
|
---|
849 | void NP_LOADDS NPN_Status(NPP instance, const char* message);
|
---|
850 | const char* NP_LOADDS NPN_UserAgent(NPP instance);
|
---|
851 | void* NP_LOADDS NPN_MemAlloc(uint32_t size);
|
---|
852 | void NP_LOADDS NPN_MemFree(void* ptr);
|
---|
853 | uint32_t NP_LOADDS NPN_MemFlush(uint32_t size);
|
---|
854 | void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
|
---|
855 | NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
|
---|
856 | void *value);
|
---|
857 | NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
|
---|
858 | void *value);
|
---|
859 | void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
|
---|
860 | void NP_LOADDS NPN_InvalidateRegion(NPP instance,
|
---|
861 | NPRegion invalidRegion);
|
---|
862 | void NP_LOADDS NPN_ForceRedraw(NPP instance);
|
---|
863 | void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
|
---|
864 | void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
|
---|
865 | void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
|
---|
866 | void (*func) (void *),
|
---|
867 | void *userData);
|
---|
868 | NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
|
---|
869 | const char *url, char **value,
|
---|
870 | uint32_t *len);
|
---|
871 | NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
|
---|
872 | const char *url, const char *value,
|
---|
873 | uint32_t len);
|
---|
874 | NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance,
|
---|
875 | const char *protocol,
|
---|
876 | const char *host, int32_t port,
|
---|
877 | const char *scheme,
|
---|
878 | const char *realm,
|
---|
879 | char **username, uint32_t *ulen,
|
---|
880 | char **password,
|
---|
881 | uint32_t *plen);
|
---|
882 | uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
|
---|
883 | void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
|
---|
884 | NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
|
---|
885 | NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
|
---|
886 | NPBool NP_LOADDS NPN_HandleEvent(NPP instance, void *event, NPBool handled);
|
---|
887 | NPBool NP_LOADDS NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
|
---|
888 | void NP_LOADDS NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);
|
---|
889 |
|
---|
890 | #ifdef __cplusplus
|
---|
891 | } /* end extern "C" */
|
---|
892 | #endif
|
---|
893 |
|
---|
894 | #endif /* RC_INVOKED */
|
---|
895 | #if defined(__OS2__)
|
---|
896 | #pragma pack()
|
---|
897 | #endif
|
---|
898 |
|
---|
899 | #endif /* npapi_h_ */
|
---|