FreeWRL / FreeX3D 4.3.0
nsplugindefs.h
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 nsplugindefs_h___
39#define nsplugindefs_h___
40
41#if defined(XP_OS2) || defined(__OS2__)
42#define INCL_BASE
43#define INCL_PM
44#include <os2.h>
45#pragma pack(1)
46#endif
47
48#ifndef prtypes_h___
49#include "prtypes.h"
50#endif
51
52#ifdef XP_MACOSX
53# include <Carbon/Carbon.h>
54#endif
55
56#if defined(XP_UNIX) && defined(MOZ_X11)
57# include <X11/Xlib.h>
58# include <X11/Xutil.h>
59#endif
60
61#if defined(XP_WIN)
62# include <windef.h>
63#endif
64
66
67/* The OS/2 version of Netscape uses RC_DATA to define the
68 mime types, file extensions, etc that are required.
69 Use a vertical bar to separate types, end types with \0.
70 FileVersion and ProductVersion are 32bit ints, all other
71 entries are strings the MUST be terminated wwith a \0.
72
73AN EXAMPLE:
74
75RCDATA NS_INFO_ProductVersion { 1,0,0,1,}
76
77RCDATA NS_INFO_MIMEType { "video/x-video|",
78 "video/x-flick\0" }
79RCDATA NS_INFO_FileExtents { "avi|",
80 "flc\0" }
81RCDATA NS_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
82 "MMOS2 Flc/Fli player(*.flc)\0" }
83
84RCDATA NS_INFO_FileVersion { 1,0,0,1 }
85RCDATA NS_INFO_CompanyName { "Netscape Communications\0" }
86RCDATA NS_INFO_FileDescription { "NPAVI32 Extension DLL\0"
87RCDATA NS_INFO_InternalName { "NPAVI32\0" )
88RCDATA NS_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
89RCDATA NS_INFO_OriginalFilename { "NVAPI32.DLL" }
90RCDATA NS_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
91
92*/
93
94
95/* RC_DATA types for version info - required */
96#define NS_INFO_ProductVersion 1
97#define NS_INFO_MIMEType 2
98#define NS_INFO_FileOpenName 3
99#define NS_INFO_FileExtents 4
100
101/* RC_DATA types for version info - used if found */
102#define NS_INFO_FileDescription 5
103#define NS_INFO_ProductName 6
104
105/* RC_DATA types for version info - optional */
106#define NS_INFO_CompanyName 7
107#define NS_INFO_FileVersion 8
108#define NS_INFO_InternalName 9
109#define NS_INFO_LegalCopyright 10
110#define NS_INFO_OriginalFilename 11
111
112#ifndef RC_INVOKED
113
115// Structures and definitions
116
117#if !defined(__LP64__)
118#if defined(XP_MAC) || defined(XP_MACOSX)
119#pragma options align=mac68k
120#endif
121#endif /* __LP64__ */
122
123typedef const char* nsMIMEType;
124
126 PRInt32 offset; /* negative offset means from the end */
127 PRUint32 length;
128 struct nsByteRange* next;
129};
130
132 PRUint16 top;
133 PRUint16 left;
134 PRUint16 bottom;
135 PRUint16 right;
136};
137
139// Unix specific structures and definitions
140
141#ifdef XP_UNIX
142
143#include <stdio.h>
144
145/*
146 * Callback Structures.
147 *
148 * These are used to pass additional platform specific information.
149 */
150enum nsPluginCallbackType {
151 nsPluginCallbackType_SetWindow = 1,
152 nsPluginCallbackType_Print
153};
154
155struct nsPluginAnyCallbackStruct {
156 PRInt32 type;
157};
158
159#ifdef MOZ_X11
160struct nsPluginSetWindowCallbackStruct {
161 PRInt32 type;
162 Display* display;
163 Visual* visual;
164 Colormap colormap;
165 PRUint32 depth;
166};
167#else
168struct nsPluginSetWindowCallbackStruct {
169 PRInt32 type;
170};
171#endif
172
173
174struct nsPluginPrintCallbackStruct {
175 PRInt32 type;
176 FILE* fp;
177};
178
179#endif /* XP_UNIX */
180
182
183// List of variables which should be implmented by the plugin
184enum nsPluginVariable {
185 nsPluginVariable_NameString = 1,
186 nsPluginVariable_DescriptionString = 2
187};
188
189enum nsPluginManagerVariable {
190 nsPluginManagerVariable_XDisplay = 1,
191 nsPluginManagerVariable_XtAppContext = 2,
192 nsPluginManagerVariable_SupportsXEmbed = 14
193};
194
195enum nsPluginInstanceVariable {
196 nsPluginInstanceVariable_WindowlessBool = 3,
197 nsPluginInstanceVariable_TransparentBool = 4,
198 nsPluginInstanceVariable_DoCacheBool = 5,
199 nsPluginInstanceVariable_CallSetWindowAfterDestroyBool = 6,
200 nsPluginInstanceVariable_ScriptableInstance = 10,
201 nsPluginInstanceVariable_ScriptableIID = 11,
202 nsPluginInstanceVariable_NeedsXEmbed = 14,
203 nsPluginInstanceVariable_WantsAllNetworkStreams = 18
204#ifdef XP_MACOSX
205 , nsPluginInstanceVariable_DrawingModel = 20
206#endif
207 , nsPluginInstanceVariable_WindowlessLocalBool = 21
208};
209
210#ifdef OJI
211typedef nsPluginInstanceVariable nsPluginInstancePeerVariable;
212#endif
213
215
216enum nsPluginMode {
217 nsPluginMode_Embedded = 1,
218 nsPluginMode_Full
219};
220
221// XXX this can go away now
222enum nsPluginStreamType {
223 nsPluginStreamType_Normal = 1,
224 nsPluginStreamType_Seek,
225 nsPluginStreamType_AsFile,
226 nsPluginStreamType_AsFileOnly
227};
228
229/*
230 * The type of a nsPluginWindow - it specifies the type of the data structure
231 * returned in the window field.
232 */
233enum nsPluginWindowType {
234 nsPluginWindowType_Window = 1,
235 nsPluginWindowType_Drawable
236};
237
238#ifdef XP_MACOSX
239
240typedef WindowRef nsPluginPlatformWindowRef;
241
242#ifndef NP_NO_QUICKDRAW
243struct nsPluginPortQD {
244 CGrafPtr port; /* Grafport */
245 PRInt32 portx; /* position inside the topmost window */
246 PRInt32 porty;
247};
248
249typedef RgnHandle nsPluginRegionQD;
250#endif
251
252struct nsPluginPortCG {
253 CGContextRef context;
254 WindowRef window;
255};
256
257typedef CGPathRef nsPluginRegionCG;
258
259typedef union nsPluginPort {
260#ifndef NP_NO_QUICKDRAW
261 nsPluginPortQD qdPort;
262#endif
263 nsPluginPortCG cgPort;
264} nsPluginPort;
265
266typedef void* nsPluginRegion;
267
268#elif defined(XP_WIN) || defined(XP_OS2)
269
270struct nsPluginPort;
271typedef HRGN nsPluginRegion;
272typedef HWND nsPluginPlatformWindowRef;
273
274#elif defined(XP_UNIX) && defined(MOZ_X11)
275
276struct nsPluginPort;
277typedef Region nsPluginRegion;
278typedef Drawable nsPluginPlatformWindowRef;
279
280#else
281
282struct nsPluginPort;
283typedef void* nsPluginRegion;
284typedef void* nsPluginPlatformWindowRef;
285
286#endif
287
289 nsPluginPort* window; /* Platform specific window handle */
290 /* OS/2: x - Position of bottom left corner */
291 /* OS/2: y - relative to visible netscape window */
292 PRInt32 x; /* Position of top left corner relative */
293 PRInt32 y; /* to a netscape page. */
294 PRUint32 width; /* Maximum window size */
295 PRUint32 height;
296 nsPluginRect clipRect; /* Clipping rectangle in port coordinates */
297 /* Used by Mac OS X only. */
298#if defined(XP_UNIX) && !defined(XP_MACOSX)
299 void* ws_info; /* Platform-dependent additonal data */
300#endif /* XP_UNIX */
301 nsPluginWindowType type; /* Is this a window or a drawable? */
302};
303
305 PRBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
306 /* printing */
307 PRBool printOne; /* TRUE if plugin should print one copy */
308 /* to default printer */
309 void* platformPrint; /* Platform-specific printing info */
310};
311
313 nsPluginWindow window;
314 void* platformPrint; /* Platform-specific printing info */
315};
316
318 PRUint16 mode; /* nsPluginMode_Full or nsPluginMode_Embedded */
319 union
320 {
321 nsPluginFullPrint fullPrint; /* if mode is nsPluginMode_Full */
322 nsPluginEmbedPrint embedPrint; /* if mode is nsPluginMode_Embedded */
323 } print;
324};
325
327
328#ifdef XP_MACOSX
329 EventRecord* event;
330 nsPluginPlatformWindowRef window;
331
332#elif defined(XP_OS2)
333 uint32 event;
334 uint32 wParam;
335 uint32 lParam;
336
337#elif defined(XP_WIN)
338 uint16 event;
339#if defined(_WIN64)
340 uint64 wParam;
341 uint64 lParam;
342#else
343 uint32 wParam;
344 uint32 lParam;
345#endif /* _WIN64 */
346
347#elif defined(XP_UNIX) && defined(MOZ_X11)
348 XEvent event;
349#else
350 void *event;
351#endif
352};
353
355
356enum nsPluginReason {
357 nsPluginReason_Base = 0,
358 nsPluginReason_Done = 0,
359 nsPluginReason_NetworkErr,
360 nsPluginReason_UserBreak,
361 nsPluginReason_NoReason
362};
363
365// Version Numbers for Structs
366
367// These version number are for structures whose fields may evolve over time.
368// When fields are added to the end of the struct, the minor version will be
369// incremented. When the struct changes in an incompatible way the major version
370// will be incremented.
371
372#define nsMajorVersion(v) (((PRInt32)(v) >> 16) & 0xffff)
373#define nsMinorVersion(v) ((PRInt32)(v) & 0xffff)
374
375#define nsVersionOK(suppliedV, requiredV) \
376 (nsMajorVersion(suppliedV) == nsMajorVersion(requiredV) \
377 && nsMinorVersion(suppliedV) >= nsMinorVersion(requiredV))
378
379#define NP_POPUP_API_VERSION 16
380
382// Classes
384
385// Classes that must be implemented by the plugin DLL:
386class nsIPlugin; // plugin class (MIME-type handler)
387class nsIPluginInstance; // plugin instance
388
389// Classes that are implemented by the browser:
390class nsIPluginTagInfo; // describes html tag
392
393#if !defined(__LP64__)
394#if defined(XP_MAC) || defined(XP_MACOSX)
395#pragma options align=reset
396#endif
397#endif /* __LP64__ */
398
399#endif /* RC_INVOKED */
400#ifdef __OS2__
401#pragma pack()
402#endif
403
404#endif // nsplugindefs_h___
Plugin Tag Info Interface This interface provides information about the HTML tag on the page.