~x2go/x2go/x2goclient_master

« back to all changes in this revision

Viewing changes to qtbrowserplugin-2.4_1-opensource/src/qtnpapi.h

  • Committer: Reinhard Tartler
  • Author(s): Oleksander Schneyder
  • Date: 2011-01-27 20:43:11 UTC
  • Revision ID: git-v1:af42fa37d555c1031810a868db687f39c2f9e574
Imported x2goclient_3.01-16.tar.gz

Summary: Imported x2goclient_3.01-16.tar.gz
Keywords:

Imported x2goclient_3.01-16.tar.gz
into Git repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 
4
** All rights reserved.
 
5
** Contact: Nokia Corporation (qt-info@nokia.com)
 
6
**
 
7
** This file is part of a Qt Solutions component.
 
8
**
 
9
** You may use this file under the terms of the BSD license as follows:
 
10
**
 
11
** "Redistribution and use in source and binary forms, with or without
 
12
** modification, are permitted provided that the following conditions are
 
13
** met:
 
14
**   * Redistributions of source code must retain the above copyright
 
15
**     notice, this list of conditions and the following disclaimer.
 
16
**   * Redistributions in binary form must reproduce the above copyright
 
17
**     notice, this list of conditions and the following disclaimer in
 
18
**     the documentation and/or other materials provided with the
 
19
**     distribution.
 
20
**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
 
21
**     the names of its contributors may be used to endorse or promote
 
22
**     products derived from this software without specific prior written
 
23
**     permission.
 
24
**
 
25
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
26
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
27
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
28
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
29
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
30
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
31
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
32
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
33
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
34
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
35
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 
36
**
 
37
****************************************************************************/
 
38
 
 
39
// see http://www.mozilla.org/projects/plugins/ for details regarding the structs and API prototypes
 
40
 
 
41
#ifndef QTNPAPI_H
 
42
#define QTNPAPI_H
 
43
 
 
44
// Plugin API version
 
45
#define NP_VERSION_MAJOR 0
 
46
#define NP_VERSION_MINOR 17
 
47
 
 
48
// basic types
 
49
typedef unsigned short uint16;
 
50
typedef short int16;
 
51
typedef unsigned int uint32;
 
52
typedef int int32;
 
53
 
 
54
typedef unsigned char NPBool;
 
55
typedef int16 NPError;
 
56
typedef int16 NPReason;
 
57
typedef char* NPMIMEType;
 
58
 
 
59
typedef void *NPRegion;
 
60
typedef void *NPIdentifier;
 
61
 
 
62
// Java stuff
 
63
typedef void* jref;
 
64
typedef void* JRIGlobalRef;
 
65
typedef void* JRIEnv; // ### not quite correct, but we don't use it anyway
 
66
 
 
67
// NP-types
 
68
struct NPP_t
 
69
{
 
70
    void* pdata; // plug-in private data
 
71
    void* ndata; // browser private data
 
72
};
 
73
typedef NPP_t* NPP;
 
74
 
 
75
struct NPRect
 
76
{
 
77
    uint16      top;
 
78
    uint16      left;
 
79
    uint16      bottom;
 
80
    uint16      right;
 
81
};
 
82
 
 
83
#ifdef Q_WS_WIN
 
84
struct NPEvent
 
85
{
 
86
    uint16 event;
 
87
    uint32 wParam;
 
88
    uint32 lParam;
 
89
};
 
90
#elif defined(Q_WS_X11)
 
91
#  include <X11/Xlib.h>
 
92
typedef XEvent NPEvent;
 
93
#elif defined (Q_WS_MAC)
 
94
typedef struct EventRecord NPEvent;
 
95
#endif
 
96
 
 
97
// Variable names for NPP_GetValue
 
98
enum NPPVariable {
 
99
    NPPVpluginNameString = 1,
 
100
    NPPVpluginDescriptionString,
 
101
    NPPVpluginWindowBool,
 
102
    NPPVpluginTransparentBool,
 
103
    NPPVjavaClass,
 
104
    NPPVpluginWindowSize,
 
105
    NPPVpluginTimerInterval,
 
106
 
 
107
    NPPVpluginScriptableInstance = 10,
 
108
    NPPVpluginScriptableIID = 11,
 
109
 
 
110
    // Introduced in Mozilla 0.9.9
 
111
    NPPVjavascriptPushCallerBool = 12,
 
112
 
 
113
    // Introduced in Mozilla 1.0
 
114
    NPPVpluginKeepLibraryInMemory = 13,
 
115
    NPPVpluginNeedsXEmbed         = 14,
 
116
 
 
117
    // Introduced in Firefox 1.0
 
118
    NPPVpluginScriptableNPObject  = 15,
 
119
    NPPVformValue = 16
 
120
} ;
 
121
 
 
122
// Variable names for NPN_GetValue
 
123
enum NPNVariable {
 
124
    NPNVxDisplay = 1,
 
125
    NPNVxtAppContext,
 
126
    NPNVnetscapeWindow,
 
127
    NPNVjavascriptEnabledBool,
 
128
    NPNVasdEnabledBool,
 
129
    NPNVisOfflineBool,
 
130
 
 
131
    // Introduced in Mozilla 0.9.4
 
132
    NPNVserviceManager = 10,
 
133
    NPNVDOMElement     = 11,
 
134
    // Introduced in Mozilla 1.2
 
135
    NPNVDOMWindow      = 12,
 
136
    NPNVToolkit        = 13,
 
137
    NPNVSupportsXEmbedBool = 14,
 
138
 
 
139
    NPNVWindowNPObject = 15,
 
140
    NPNVPluginElementNPObject = 16
 
141
};
 
142
 
 
143
 
 
144
enum NPWindowType {
 
145
    NPWindowTypeWindow = 1, // Windowed plug-in. The window field holds a platform-specific handle to a window.
 
146
    NPWindowTypeDrawable    // Windows: HDC; Mac OS: pointer to NP_Port structure.
 
147
};
 
148
 
 
149
struct NPWindow
 
150
{
 
151
    // Platform-specific handle to a native window element in the browser's window hierarchy
 
152
    // XEmbed: "In the NPP_SetWindow call, the window parameter will be the XID of the hosting
 
153
    // XEmbed window. As an implementation note, this is really the XID of a GtkSocket window."
 
154
    void* window;
 
155
    // The x and y coordinates for the top left corner of the plug-in relative to the page
 
156
    // (and thus relative to the origin of the drawable)
 
157
    uint32 x, y;
 
158
    // The height and width of the plug-in area. Should not be modified by the plug-in.
 
159
    uint32 width, height;
 
160
    // Used by MAC only (Clipping rectangle in port coordinates)
 
161
    NPRect clipRect;
 
162
#ifdef Q_WS_X11
 
163
    // Contains information about the plug-in's Unix window environment
 
164
    // points to an NPSetWindowCallbackStruct
 
165
    void* ws_info; // probably obsolete with XEmbed
 
166
#endif
 
167
    // The type field indicates the NPWindow type of the target area
 
168
    NPWindowType type;
 
169
};
 
170
 
 
171
struct NPPort
 
172
{
 
173
    void *port;
 
174
    int32 portx;
 
175
    int32 porty;
 
176
};
 
177
 
 
178
struct NPFullPrint
 
179
{
 
180
    NPBool pluginPrinted;       // true if plugin handled fullscreen printing
 
181
    NPBool printOne;            // true if plugin should print one copy to default printer
 
182
    void* platformPrint;        // Platform-specific printing info
 
183
};
 
184
 
 
185
struct NPEmbedPrint
 
186
{
 
187
    NPWindow window;
 
188
    void* platformPrint;        // Platform-specific printing info
 
189
};
 
190
 
 
191
struct NPPrint
 
192
{
 
193
    uint16 mode; // NP_FULL or NP_EMBED
 
194
    union {
 
195
        NPFullPrint fullPrint;
 
196
        NPEmbedPrint embedPrint;
 
197
    } print;
 
198
};
 
199
 
 
200
struct NPSavedData
 
201
{
 
202
    int32 len;
 
203
    void* buf;
 
204
};
 
205
 
 
206
struct NPStream
 
207
{
 
208
    void* pdata;
 
209
    void* ndata;
 
210
    const char* url;
 
211
    uint32 end;
 
212
    uint32 lastmodified;
 
213
    void* notifyData;
 
214
};
 
215
 
 
216
struct NPByteRange
 
217
{
 
218
    int32 offset; // negative offset means from the end
 
219
    uint32 length;
 
220
    NPByteRange* next;
 
221
};
 
222
 
 
223
// Values for mode passed to NPP_New:
 
224
#define NP_EMBED      1
 
225
#define NP_FULL       2
 
226
 
 
227
// Values for stream type passed to NPP_NewStream:
 
228
#define NP_NORMAL     1
 
229
#define NP_SEEK       2
 
230
#define NP_ASFILE     3
 
231
#define NP_ASFILEONLY 4
 
232
 
 
233
#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
 
234
 
 
235
// Values of type NPError:
 
236
#define NPERR_NO_ERROR                      0
 
237
#define NPERR_GENERIC_ERROR                 1
 
238
#define NPERR_INVALID_INSTANCE_ERROR        2
 
239
#define NPERR_INVALID_FUNCTABLE_ERROR       3
 
240
#define NPERR_MODULE_LOAD_FAILED_ERROR      4
 
241
#define NPERR_OUT_OF_MEMORY_ERROR           5
 
242
#define NPERR_INVALID_PLUGIN_ERROR          6
 
243
#define NPERR_INVALID_PLUGIN_DIR_ERROR      7
 
244
#define NPERR_INCOMPATIBLE_VERSION_ERROR    8
 
245
#define NPERR_INVALID_PARAM                 9
 
246
#define NPERR_INVALID_URL                   10
 
247
#define NPERR_FILE_NOT_FOUND                11
 
248
#define NPERR_NO_DATA                       12
 
249
#define NPERR_STREAM_NOT_SEEKABLE           13
 
250
 
 
251
// Values of type NPReason:
 
252
#define NPRES_DONE                          0
 
253
#define NPRES_NETWORK_ERR                   1
 
254
#define NPRES_USER_BREAK                    2
 
255
 
 
256
// Version feature information
 
257
#define NPVERS_HAS_STREAMOUTPUT             8
 
258
#define NPVERS_HAS_NOTIFICATION             9
 
259
#define NPVERS_HAS_LIVECONNECT              9
 
260
#define NPVERS_WIN16_HAS_LIVECONNECT        10
 
261
 
 
262
// Mac specifics
 
263
#ifdef Q_WS_MAC
 
264
# define getFocusEvent       (osEvt + 16)
 
265
# define loseFocusEvent      (osEvt + 17)
 
266
# define adjustCursorEvent   (osEvt + 18)
 
267
# define QTBROWSER_USE_CFM
 
268
#endif
 
269
 
 
270
#ifdef QTBROWSER_USE_CFM
 
271
 extern void *CFMFunctionPointerForMachOFunctionPointer(void*);
 
272
 extern void DisposeCFMFunctionPointer(void *);
 
273
 extern void* MachOFunctionPointerForCFMFunctionPointer(void*);
 
274
# define FUNCTION_POINTER(t) void*
 
275
# define MAKE_FUNCTION_POINTER(f) CFMFunctionPointerForMachOFunctionPointer((void*)f)
 
276
# define DESTROY_FUNCTION_POINTER(n) DisposeCFMFunctionPointer(n)
 
277
# define FIND_FUNCTION_POINTER(t, n) (*(t)MachOFunctionPointerForCFMFunctionPointer(n))
 
278
#else
 
279
# define FUNCTION_POINTER(t) t
 
280
# define MAKE_FUNCTION_POINTER(f) f
 
281
# define DESTROY_FUNCTION_POINTER(n)
 
282
# define FIND_FUNCTION_POINTER(t, n) (*n)
 
283
#endif
 
284
 
 
285
// Plugin function prototypes
 
286
typedef NPError (*NPP_NewFP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
 
287
typedef NPError (*NPP_DestroyFP)(NPP instance, NPSavedData** save);
 
288
typedef NPError (*NPP_SetWindowFP)(NPP instance, NPWindow* window);
 
289
typedef NPError (*NPP_NewStreamFP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
 
290
typedef NPError (*NPP_DestroyStreamFP)(NPP instance, NPStream* stream, NPReason reason);
 
291
typedef void (*NPP_StreamAsFileFP)(NPP instance, NPStream* stream, const char* fname);
 
292
typedef int32 (*NPP_WriteReadyFP)(NPP instance, NPStream* stream);
 
293
typedef int32 (*NPP_WriteFP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
 
294
typedef void (*NPP_PrintFP)(NPP instance, NPPrint* platformPrint);
 
295
typedef int16 (*NPP_HandleEventFP)(NPP instance, NPEvent* event);
 
296
typedef void (*NPP_URLNotifyFP)(NPP instance, const char* url, NPReason reason, void* notifyData);
 
297
typedef NPError (*NPP_GetValueFP)(NPP instance, NPPVariable variable, void *value);
 
298
typedef NPError (*NPP_SetValueFP)(NPP instance, NPPVariable variable, void *value);
 
299
 
 
300
// table of functions implemented by the plugin
 
301
struct NPPluginFuncs {
 
302
    uint16 size;
 
303
    uint16 version;
 
304
    FUNCTION_POINTER(NPP_NewFP) newp;
 
305
    FUNCTION_POINTER(NPP_DestroyFP) destroy;
 
306
    FUNCTION_POINTER(NPP_SetWindowFP) setwindow;
 
307
    FUNCTION_POINTER(NPP_NewStreamFP) newstream;
 
308
    FUNCTION_POINTER(NPP_DestroyStreamFP) destroystream;
 
309
    FUNCTION_POINTER(NPP_StreamAsFileFP) asfile;
 
310
    FUNCTION_POINTER(NPP_WriteReadyFP) writeready;
 
311
    FUNCTION_POINTER(NPP_WriteFP) write;
 
312
    FUNCTION_POINTER(NPP_PrintFP) print;
 
313
    FUNCTION_POINTER(NPP_HandleEventFP) event;
 
314
    FUNCTION_POINTER(NPP_URLNotifyFP) urlnotify;
 
315
    JRIGlobalRef javaClass;
 
316
    FUNCTION_POINTER(NPP_GetValueFP) getvalue;
 
317
    FUNCTION_POINTER(NPP_SetValueFP) setvalue;
 
318
} ;
 
319
 
 
320
 
 
321
// forward declarations
 
322
struct NPObject;
 
323
struct NPClass;
 
324
struct NPVariant;
 
325
struct NPString;
 
326
struct QtNPInstance;
 
327
 
 
328
// NPObject is the type used to express objects exposed by either
 
329
// the plugin or by the browser. Implementation specific  (i.e. plugin
 
330
// specific, or browser specific) members can come after the struct.
 
331
// In our case, the plugin specific member (aka QObject) lives in NPClass.
 
332
struct NPObject
 
333
{
 
334
    NPClass *_class;
 
335
    uint32 refCount;
 
336
};
 
337
 
 
338
// NPClass is what virtual function tables would look like if
 
339
// there was no C++...
 
340
typedef NPObject *(*NPAllocateFP)(NPP npp, NPClass *aClass);
 
341
typedef void (*NPDeallocateFP)(NPObject *npobj);
 
342
typedef void (*NPInvalidateFP)(NPObject *npobj);
 
343
typedef bool (*NPHasMethodFP)(NPObject *npobj, NPIdentifier name);
 
344
typedef bool (*NPInvokeFP)(NPObject *npobj, NPIdentifier name,const NPVariant *args, uint32 argCount,NPVariant *result);
 
345
typedef bool (*NPInvokeDefaultFP)(NPObject *npobj,const NPVariant *args,uint32 argCount,NPVariant *result);
 
346
typedef bool (*NPHasPropertyFP)(NPObject *npobj, NPIdentifier name);
 
347
typedef bool (*NPGetPropertyFP)(NPObject *npobj, NPIdentifier name, NPVariant *result);
 
348
typedef bool (*NPSetPropertyFP)(NPObject *npobj, NPIdentifier name, const NPVariant *value);
 
349
typedef bool (*NPRemovePropertyFP)(NPObject *npobj, NPIdentifier name);
 
350
 
 
351
#define NP_CLASS_STRUCT_VERSION 1
 
352
 
 
353
struct NPClass
 
354
{
 
355
    NPClass(QtNPInstance *qtnp);
 
356
    ~NPClass();
 
357
 
 
358
    // NP API
 
359
    uint32 structVersion;
 
360
    NPAllocateFP allocate;
 
361
    NPDeallocateFP deallocate;
 
362
    NPInvalidateFP invalidate;
 
363
    NPHasMethodFP hasMethod;
 
364
    NPInvokeFP invoke;
 
365
    NPInvokeDefaultFP invokeDefault;
 
366
    NPHasPropertyFP hasProperty;
 
367
    NPGetPropertyFP getProperty;
 
368
    NPSetPropertyFP setProperty;
 
369
    NPRemovePropertyFP removeProperty;
 
370
 
 
371
    // User data lives here
 
372
    QtNPInstance *qtnp;
 
373
    bool delete_qtnp;
 
374
};
 
375
 
 
376
struct NPString {
 
377
    const char *utf8characters;
 
378
    uint32 utf8length;
 
379
 
 
380
    // Qt specific conversion routines
 
381
    // (no c'tor as it would be misleading that there is no d'tor in spite of memory allocation)
 
382
    static NPString fromQString(const QString &qstr);
 
383
    operator QString() const;
 
384
};
 
385
 
 
386
struct NPVariant {
 
387
    enum Type {
 
388
        Void,
 
389
        Null,
 
390
        Boolean,
 
391
        Int32,
 
392
        Double,
 
393
        String,
 
394
        Object
 
395
    };
 
396
    Type type;
 
397
    union {
 
398
        bool boolValue;
 
399
        uint32 intValue;
 
400
        double doubleValue;
 
401
        NPString stringValue;
 
402
        NPObject *objectValue;
 
403
    } value;
 
404
 
 
405
    NPVariant()
 
406
        : type(Null)
 
407
    {}
 
408
 
 
409
    // Qt specific conversion routines
 
410
    // (no c'tor as the NPP instance is required)
 
411
    static NPVariant fromQVariant(QtNPInstance *This, const QVariant &qvariant);
 
412
    operator QVariant() const;
 
413
 
 
414
private:
 
415
};
 
416
 
 
417
#ifdef Q_WS_X11
 
418
extern "C" {
 
419
#endif
 
420
 
 
421
// Browser function prototypes
 
422
typedef NPError (*NPN_GetURLFP)(NPP instance, const char* url, const char* window);
 
423
typedef NPError (*NPN_PostURLFP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
 
424
typedef NPError (*NPN_RequestReadFP)(NPStream* stream, NPByteRange* rangeList);
 
425
typedef NPError (*NPN_NewStreamFP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
 
426
typedef int32 (*NPN_WriteFP)(NPP instance, NPStream* stream, int32 len, void* buffer);
 
427
typedef NPError (*NPN_DestroyStreamFP)(NPP instance, NPStream* stream, NPReason reason);
 
428
typedef void (*NPN_StatusFP)(NPP instance, const char* message);
 
429
typedef const char* (*NPN_UserAgentFP)(NPP instance);
 
430
typedef void* (*NPN_MemAllocFP)(uint32 size);
 
431
typedef void (*NPN_MemFreeFP)(void* ptr);
 
432
typedef uint32 (*NPN_MemFlushFP)(uint32 size);
 
433
typedef void (*NPN_ReloadPluginsFP)(NPBool reloadPages);
 
434
typedef JRIEnv* (*NPN_GetJavaEnvFP)(void);
 
435
typedef jref (*NPN_GetJavaPeerFP)(NPP instance);
 
436
typedef NPError (*NPN_GetURLNotifyFP)(NPP instance, const char* url, const char* window, void* notifyData);
 
437
typedef NPError (*NPN_PostURLNotifyFP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
 
438
typedef NPError (*NPN_GetValueFP)(NPP instance, NPNVariable variable, void *ret_value);
 
439
typedef NPError (*NPN_SetValueFP)(NPP instance, NPPVariable variable, void *ret_value);
 
440
typedef void (*NPN_InvalidateRectFP)(NPP instance, NPRect *rect);
 
441
typedef void (*NPN_InvalidateRegionFP)(NPP instance, NPRegion *region);
 
442
typedef void (*NPN_ForceRedrawFP)(NPP instance);
 
443
typedef NPIdentifier (*NPN_GetStringIdentifierFP)(const char* name);
 
444
typedef void (*NPN_GetStringIdentifiersFP)(const char** names, int32 nameCount, NPIdentifier* identifiers);
 
445
typedef NPIdentifier (*NPN_GetIntIdentifierFP)(int32 intid);
 
446
typedef bool (*NPN_IdentifierIsStringFP)(NPIdentifier identifier);
 
447
typedef char* (*NPN_UTF8FromIdentifierFP)(NPIdentifier identifier);
 
448
typedef int32 (*NPN_IntFromIdentifierFP)(NPIdentifier identifier);
 
449
typedef NPObject* (*NPN_CreateObjectFP)(NPP npp, NPClass *aClass);
 
450
typedef NPObject* (*NPN_RetainObjectFP)(NPObject *obj);
 
451
typedef void (*NPN_ReleaseObjectFP)(NPObject *obj);
 
452
typedef bool (*NPN_InvokeFP)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, int32 argCount, NPVariant *result);
 
453
typedef bool (*NPN_InvokeDefaultFP)(NPP npp, NPObject* obj, const NPVariant *args, int32 argCount, NPVariant *result);
 
454
typedef bool (*NPN_EvaluateFP)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
 
455
typedef bool (*NPN_GetPropertyFP)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
 
456
typedef bool (*NPN_SetPropertyFP)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
 
457
typedef bool (*NPN_RemovePropertyFP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
 
458
typedef bool (*NPN_HasPropertyFP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
 
459
typedef bool (*NPN_HasMethodFP)(NPP npp, NPObject *obj, NPIdentifier methodName);
 
460
typedef void (*NPN_ReleaseVariantValueFP)(NPVariant *variant);
 
461
typedef void (*NPN_SetExceptionFP)(NPObject *obj, const char *message);
 
462
 
 
463
// function declarations
 
464
NPError NPN_GetURL(NPP instance, const char* url, const char* window);
 
465
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
 
466
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
 
467
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
 
468
int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
 
469
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
 
470
void NPN_Status(NPP instance, const char* message);
 
471
const char* NPN_UserAgent(NPP instance);
 
472
void* NPN_MemAlloc(uint32 size);
 
473
void NPN_MemFree(void* ptr);
 
474
uint32 NPN_MemFlush(uint32 size);
 
475
void NPN_ReloadPlugins(NPBool reloadPages);
 
476
JRIEnv* NPN_GetJavaEnv(void);
 
477
jref NPN_GetJavaPeer(NPP instance);
 
478
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData);
 
479
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
 
480
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *ret_value);
 
481
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *ret_value);
 
482
void NPN_InvalidateRect(NPP instance, NPRect *rect);
 
483
void NPN_InvalidateRegion(NPP instance, NPRegion *region);
 
484
void NPN_ForceRedraw(NPP instance);
 
485
NPIdentifier NPN_GetStringIdentifier(const char* name);
 
486
void NPN_GetStringIdentifiers(const char** names, int32 nameCount, NPIdentifier* identifiers);
 
487
NPIdentifier NPN_GetIntIdentifier(int32 intid);
 
488
bool NPN_IdentifierIsString(NPIdentifier identifier);
 
489
char* NPN_UTF8FromIdentifier(NPIdentifier identifier);
 
490
int32 NPN_IntFromIdentifier(NPIdentifier identifier);
 
491
NPObject* NPN_CreateObject(NPP npp, NPClass *aClass);
 
492
NPObject* NPN_RetainObject(NPObject *obj);
 
493
void NPN_ReleaseObject(NPObject *obj);
 
494
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, int32 argCount, NPVariant *result);
 
495
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args, int32 argCount, NPVariant *result);
 
496
bool NPN_Evaluate(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
 
497
bool NPN_GetProperty(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
 
498
bool NPN_SetProperty(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
 
499
bool NPN_RemoveProperty(NPP npp, NPObject *obj, NPIdentifier propertyName);
 
500
bool NPN_HasProperty(NPP npp, NPObject *obj, NPIdentifier propertyName);
 
501
bool NPN_HasMethod(NPP npp, NPObject *obj, NPIdentifier methodName);
 
502
void NPN_ReleaseVariantValue(NPVariant *variant);
 
503
void NPN_SetException(NPObject *obj, const char *message);
 
504
 
 
505
// table of function implemented by the browser
 
506
struct NPNetscapeFuncs {
 
507
    uint16 size;
 
508
    uint16 version;
 
509
    FUNCTION_POINTER(NPN_GetURLFP) geturl;
 
510
    FUNCTION_POINTER(NPN_PostURLFP) posturl;
 
511
    FUNCTION_POINTER(NPN_RequestReadFP) requestread;
 
512
    FUNCTION_POINTER(NPN_NewStreamFP) newstream;
 
513
    FUNCTION_POINTER(NPN_WriteFP) write;
 
514
    FUNCTION_POINTER(NPN_DestroyStreamFP) destroystream;
 
515
    FUNCTION_POINTER(NPN_StatusFP) status;
 
516
    FUNCTION_POINTER(NPN_UserAgentFP) uagent;
 
517
    FUNCTION_POINTER(NPN_MemAllocFP) memalloc;
 
518
    FUNCTION_POINTER(NPN_MemFreeFP) memfree;
 
519
    FUNCTION_POINTER(NPN_MemFlushFP) memflush;
 
520
    FUNCTION_POINTER(NPN_ReloadPluginsFP) reloadplugins;
 
521
    FUNCTION_POINTER(NPN_GetJavaEnvFP) getJavaEnv;
 
522
    FUNCTION_POINTER(NPN_GetJavaPeerFP) getJavaPeer;
 
523
    FUNCTION_POINTER(NPN_GetURLNotifyFP) geturlnotify;
 
524
    FUNCTION_POINTER(NPN_PostURLNotifyFP) posturlnotify;
 
525
    FUNCTION_POINTER(NPN_GetValueFP) getvalue;
 
526
    FUNCTION_POINTER(NPN_SetValueFP) setvalue;
 
527
    FUNCTION_POINTER(NPN_InvalidateRectFP) invalidaterect;
 
528
    FUNCTION_POINTER(NPN_InvalidateRegionFP) invalidateregion;
 
529
    FUNCTION_POINTER(NPN_ForceRedrawFP) forceredraw;
 
530
    FUNCTION_POINTER(NPN_GetStringIdentifierFP) getstringidentifier;
 
531
    FUNCTION_POINTER(NPN_GetStringIdentifiersFP) getstringidentifiers;
 
532
    FUNCTION_POINTER(NPN_GetIntIdentifierFP) getintidentifier;
 
533
    FUNCTION_POINTER(NPN_IdentifierIsStringFP) identifierisstring;
 
534
    FUNCTION_POINTER(NPN_UTF8FromIdentifierFP) utf8fromidentifier;
 
535
    FUNCTION_POINTER(NPN_IntFromIdentifierFP) intfromidentifier;
 
536
    FUNCTION_POINTER(NPN_CreateObjectFP) createobject;
 
537
    FUNCTION_POINTER(NPN_RetainObjectFP) retainobject;
 
538
    FUNCTION_POINTER(NPN_ReleaseObjectFP) releaseobject;
 
539
    FUNCTION_POINTER(NPN_InvokeFP) invoke;
 
540
    FUNCTION_POINTER(NPN_InvokeDefaultFP) invokedefault;
 
541
    FUNCTION_POINTER(NPN_EvaluateFP) evaluate;
 
542
    FUNCTION_POINTER(NPN_GetPropertyFP) getproperty;
 
543
    FUNCTION_POINTER(NPN_SetPropertyFP) setproperty;
 
544
    FUNCTION_POINTER(NPN_RemovePropertyFP) removeproperty;
 
545
    FUNCTION_POINTER(NPN_HasPropertyFP) hasproperty;
 
546
    FUNCTION_POINTER(NPN_HasMethodFP) hasmethod;
 
547
    FUNCTION_POINTER(NPN_ReleaseVariantValueFP) releasevariantvalue;
 
548
    FUNCTION_POINTER(NPN_SetExceptionFP) setexception;
 
549
};
 
550
 
 
551
#ifdef Q_WS_X11
 
552
}
 
553
#endif
 
554
 
 
555
#endif