Warning, file /multimedia/kmplayer/src/moz-sdk/npfunctions.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
0002 /* ***** BEGIN LICENSE BLOCK *****
0003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
0004  *
0005  * The contents of this file are subject to the Mozilla Public License Version
0006  * 1.1 (the "License"); you may not use this file except in compliance with
0007  * the License. You may obtain a copy of the License at
0008  * http://www.mozilla.org/MPL/
0009  *
0010  * Software distributed under the License is distributed on an "AS IS" basis,
0011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
0012  * for the specific language governing rights and limitations under the
0013  * License.
0014  *
0015  * The Original Code is mozilla.org code.
0016  *
0017  * The Initial Developer of the Original Code is
0018  * Netscape Communications Corporation.
0019  * Portions created by the Initial Developer are Copyright (C) 1998
0020  * the Initial Developer. All Rights Reserved.
0021  *
0022  * Contributor(s):
0023  *
0024  * Alternatively, the contents of this file may be used under the terms of
0025  * either the GNU General Public License Version 2 or later (the "GPL"), or
0026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
0027  * in which case the provisions of the GPL or the LGPL are applicable instead
0028  * of those above. If you wish to allow use of your version of this file only
0029  * under the terms of either the GPL or the LGPL, and not to allow others to
0030  * use your version of this file under the terms of the MPL, indicate your
0031  * decision by deleting the provisions above and replace them with the notice
0032  * and other provisions required by the GPL or the LGPL. If you do not delete
0033  * the provisions above, a recipient may use your version of this file under
0034  * the terms of any one of the MPL, the GPL or the LGPL.
0035  *
0036  * ***** END LICENSE BLOCK ***** */
0037 
0038 #ifndef npfunctions_h_
0039 #define npfunctions_h_
0040 
0041 #ifdef __OS2__
0042 #pragma pack(1)
0043 #define NP_LOADDS _System
0044 #else
0045 #define NP_LOADDS
0046 #endif
0047 
0048 #ifndef GENERATINGCFM
0049 #define GENERATINGCFM 0
0050 #endif
0051 
0052 #include "npapi.h"
0053 #include "npruntime.h"
0054 
0055 typedef void         (* NP_LOADDS NPP_InitializeProcPtr)();
0056 typedef void         (* NP_LOADDS NPP_ShutdownProcPtr)();
0057 typedef NPError      (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
0058 typedef NPError      (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
0059 typedef NPError      (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
0060 typedef NPError      (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
0061 typedef NPError      (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
0062 typedef int32_t      (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
0063 typedef int32_t      (* NP_LOADDS NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
0064 typedef void         (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
0065 typedef void         (* NP_LOADDS NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
0066 typedef int16_t      (* NP_LOADDS NPP_HandleEventProcPtr)(NPP instance, void* event);
0067 typedef void         (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance, const char* url, NPReason reason, void* notifyData);
0068 typedef NPError      (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
0069 typedef NPError      (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
0070 
0071 typedef NPError      (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
0072 typedef NPError      (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
0073 typedef NPError      (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url, const char* window, void* notifyData);
0074 typedef NPError      (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData);
0075 typedef NPError      (*NPN_GetURLProcPtr)(NPP instance, const char* url, const char* window);
0076 typedef NPError      (*NPN_PostURLProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file);
0077 typedef NPError      (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
0078 typedef NPError      (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
0079 typedef int32_t      (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32_t len, void* buffer);
0080 typedef NPError      (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
0081 typedef void         (*NPN_StatusProcPtr)(NPP instance, const char* message);
0082 typedef const char*  (*NPN_UserAgentProcPtr)(NPP instance);
0083 typedef void*        (*NPN_MemAllocProcPtr)(uint32_t size);
0084 typedef void         (*NPN_MemFreeProcPtr)(void* ptr);
0085 typedef uint32_t     (*NPN_MemFlushProcPtr)(uint32_t size);
0086 typedef void         (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
0087 typedef void*        (*NPN_GetJavaEnvProcPtr)();
0088 typedef void*        (*NPN_GetJavaPeerProcPtr)(NPP instance);
0089 typedef void         (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
0090 typedef void         (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
0091 typedef void         (*NPN_ForceRedrawProcPtr)(NPP instance);
0092 typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr)(const NPUTF8* name);
0093 typedef void         (*NPN_GetStringIdentifiersProcPtr)(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers);
0094 typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr)(int32_t intid);
0095 typedef bool         (*NPN_IdentifierIsStringProcPtr)(NPIdentifier identifier);
0096 typedef NPUTF8*      (*NPN_UTF8FromIdentifierProcPtr)(NPIdentifier identifier);
0097 typedef int32_t      (*NPN_IntFromIdentifierProcPtr)(NPIdentifier identifier);
0098 typedef NPObject*    (*NPN_CreateObjectProcPtr)(NPP npp, NPClass *aClass);
0099 typedef NPObject*    (*NPN_RetainObjectProcPtr)(NPObject *obj);
0100 typedef void         (*NPN_ReleaseObjectProcPtr)(NPObject *obj);
0101 typedef bool         (*NPN_InvokeProcPtr)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
0102 typedef bool         (*NPN_InvokeDefaultProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
0103 typedef bool         (*NPN_EvaluateProcPtr)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
0104 typedef bool         (*NPN_GetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
0105 typedef bool         (*NPN_SetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
0106 typedef bool         (*NPN_RemovePropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
0107 typedef bool         (*NPN_HasPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
0108 typedef bool         (*NPN_HasMethodProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
0109 typedef void         (*NPN_ReleaseVariantValueProcPtr)(NPVariant *variant);
0110 typedef void         (*NPN_SetExceptionProcPtr)(NPObject *obj, const NPUTF8 *message);
0111 typedef bool         (*NPN_PushPopupsEnabledStateProcPtr)(NPP npp, NPBool enabled);
0112 typedef bool         (*NPN_PopPopupsEnabledStateProcPtr)(NPP npp);
0113 typedef bool         (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj, NPIdentifier **identifier, uint32_t *count);
0114 typedef void         (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, void (*func)(void *), void *userData);
0115 typedef bool         (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
0116 typedef NPError      (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, char **value, uint32_t *len);
0117 typedef NPError      (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, const char *value, uint32_t len);
0118 typedef NPError      (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen);
0119 
0120 typedef struct _NPPluginFuncs {
0121   uint16_t size;
0122   uint16_t version;
0123   NPP_NewProcPtr newp;
0124   NPP_DestroyProcPtr destroy;
0125   NPP_SetWindowProcPtr setwindow;
0126   NPP_NewStreamProcPtr newstream;
0127   NPP_DestroyStreamProcPtr destroystream;
0128   NPP_StreamAsFileProcPtr asfile;
0129   NPP_WriteReadyProcPtr writeready;
0130   NPP_WriteProcPtr write;
0131   NPP_PrintProcPtr print;
0132   NPP_HandleEventProcPtr event;
0133   NPP_URLNotifyProcPtr urlnotify;
0134   void* javaClass;
0135   NPP_GetValueProcPtr getvalue;
0136   NPP_SetValueProcPtr setvalue;
0137 } NPPluginFuncs;
0138 
0139 typedef struct _NPNetscapeFuncs {
0140   uint16_t size;
0141   uint16_t version;
0142   NPN_GetURLProcPtr geturl;
0143   NPN_PostURLProcPtr posturl;
0144   NPN_RequestReadProcPtr requestread;
0145   NPN_NewStreamProcPtr newstream;
0146   NPN_WriteProcPtr write;
0147   NPN_DestroyStreamProcPtr destroystream;
0148   NPN_StatusProcPtr status;
0149   NPN_UserAgentProcPtr uagent;
0150   NPN_MemAllocProcPtr memalloc;
0151   NPN_MemFreeProcPtr memfree;
0152   NPN_MemFlushProcPtr memflush;
0153   NPN_ReloadPluginsProcPtr reloadplugins;
0154   NPN_GetJavaEnvProcPtr getJavaEnv;
0155   NPN_GetJavaPeerProcPtr getJavaPeer;
0156   NPN_GetURLNotifyProcPtr geturlnotify;
0157   NPN_PostURLNotifyProcPtr posturlnotify;
0158   NPN_GetValueProcPtr getvalue;
0159   NPN_SetValueProcPtr setvalue;
0160   NPN_InvalidateRectProcPtr invalidaterect;
0161   NPN_InvalidateRegionProcPtr invalidateregion;
0162   NPN_ForceRedrawProcPtr forceredraw;
0163   NPN_GetStringIdentifierProcPtr getstringidentifier;
0164   NPN_GetStringIdentifiersProcPtr getstringidentifiers;
0165   NPN_GetIntIdentifierProcPtr getintidentifier;
0166   NPN_IdentifierIsStringProcPtr identifierisstring;
0167   NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
0168   NPN_IntFromIdentifierProcPtr intfromidentifier;
0169   NPN_CreateObjectProcPtr createobject;
0170   NPN_RetainObjectProcPtr retainobject;
0171   NPN_ReleaseObjectProcPtr releaseobject;
0172   NPN_InvokeProcPtr invoke;
0173   NPN_InvokeDefaultProcPtr invokeDefault;
0174   NPN_EvaluateProcPtr evaluate;
0175   NPN_GetPropertyProcPtr getproperty;
0176   NPN_SetPropertyProcPtr setproperty;
0177   NPN_RemovePropertyProcPtr removeproperty;
0178   NPN_HasPropertyProcPtr hasproperty;
0179   NPN_HasMethodProcPtr hasmethod;
0180   NPN_ReleaseVariantValueProcPtr releasevariantvalue;
0181   NPN_SetExceptionProcPtr setexception;
0182   NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
0183   NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
0184   NPN_EnumerateProcPtr enumerate;
0185   NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
0186   NPN_ConstructProcPtr construct;
0187   NPN_GetValueForURLPtr getvalueforurl;
0188   NPN_SetValueForURLPtr setvalueforurl;
0189   NPN_GetAuthenticationInfoPtr getauthenticationinfo;
0190 } NPNetscapeFuncs;
0191 
0192 #ifdef XP_MACOSX
0193 /* Don't use this, it is going away. */
0194 typedef NPError (* NPP_MainEntryProcPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
0195 /*
0196  * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
0197  * These can be called to retreive MIME information from the plugin dynamically
0198  *
0199  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
0200  *       to get mime info from the plugin only on OSX and may not be supported 
0201  *       in furture version -- use NP_GetMIMEDescription instead
0202  */
0203 enum
0204 {
0205  kBPSupportedMIMETypesStructVers_1    = 1
0206 };
0207 typedef struct _BPSupportedMIMETypes
0208 {
0209  SInt32    structVersion;      /* struct version */
0210  Handle    typeStrings;        /* STR# formated handle, allocated by plug-in */
0211  Handle    infoStrings;        /* STR# formated handle, allocated by plug-in */
0212 } BPSupportedMIMETypes;
0213 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
0214 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
0215 typedef const char* (*NP_GetMIMEDescriptionProcPtr)();
0216 typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, UInt32);
0217 #endif
0218 
0219 #if defined(_WINDOWS)
0220 #define OSCALL WINAPI
0221 #else
0222 #if defined(__OS2__)
0223 #define OSCALL _System
0224 #else
0225 #define OSCALL
0226 #endif
0227 #endif
0228 
0229 #if defined(XP_UNIX)
0230 /* GCC 3.3 and later support the visibility attribute. */
0231 #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
0232 #define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
0233 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
0234 #define NP_VISIBILITY_DEFAULT __global
0235 #else
0236 #define NP_VISIBILITY_DEFAULT
0237 #endif
0238 #define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
0239 #endif
0240 
0241 #if defined(_WINDOWS) || defined (__OS2__)
0242 #ifdef __cplusplus
0243 extern "C" {
0244 #endif
0245 /* plugin meta member functions */
0246 #if defined(__OS2__)
0247 typedef struct _NPPluginData {   /* Alternate OS2 Plugin interface */
0248   char *pMimeTypes;
0249   char *pFileExtents;
0250   char *pFileOpenTemplate;
0251   char *pProductName;
0252   char *pProductDescription;
0253   unsigned long dwProductVersionMS;
0254   unsigned long dwProductVersionLS;
0255 } NPPluginData;
0256 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
0257 #endif
0258 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
0259 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs);
0260 NPError OSCALL NP_Shutdown();
0261 char*          NP_GetMIMEDescription();
0262 #ifdef __cplusplus
0263 }
0264 #endif
0265 #endif
0266 
0267 #if defined(__OS2__)
0268 #pragma pack()
0269 #endif
0270 
0271 #ifdef XP_UNIX
0272 #ifdef __cplusplus
0273 extern "C" {
0274 #endif
0275 NP_EXPORT(char*)   NP_GetPluginVersion();
0276 NP_EXPORT(char*)   NP_GetMIMEDescription();
0277 #ifdef XP_MACOSX
0278 NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
0279 #else
0280 NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
0281 #endif
0282 NP_EXPORT(NPError) NP_Shutdown();
0283 NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
0284 #ifdef __cplusplus
0285 }
0286 #endif
0287 #endif
0288 
0289 #endif /* npfunctions_h_ */