npapidefs.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. // npapidefs.h
  2. // minimal version of the defs from the NS plugin SDK
  3. #ifndef NPAPIDEFS_H
  4. #define NPAPIDEFS_H
  5. #define NP_VERSION_MAJOR 0
  6. #define NP_VERSION_MINOR 11
  7. #define NPVERS_HAS_STREAMOUTPUT 8
  8. #define NPVERS_HAS_NOTIFICATION 9
  9. #define NPVERS_HAS_LIVECONNECT 9
  10. #define NPVERS_HAS_WINDOWLESS 11
  11. #define NPERR_NO_ERROR 0
  12. #define NPERR_GENERIC_ERROR 1
  13. #define NPERR_INVALID_INSTANCE_ERROR 2
  14. #define NPERR_INVALID_FUNCTABLE_ERROR 3
  15. #define NPERR_MODULE_LOAD_FAILED_ERROR 4
  16. #define NPERR_OUT_OF_MEMORY_ERROR 5
  17. #define NPERR_INVALID_PLUGIN_ERROR 6
  18. #define NPERR_INVALID_PLUGIN_DIR_ERROR 7
  19. #define NPERR_INCOMPATIBLE_VERSION_ERROR 8
  20. #define NPERR_INVALID_PARAM 9
  21. #define NPERR_INVALID_URL 10
  22. #define NPERR_FILE_NOT_FOUND 11
  23. #define NPERR_NO_DATA 12
  24. #define NPERR_STREAM_NOT_SEEKABLE 13
  25. #define NP_EMBED 1
  26. #define NP_FULL 2
  27. #define NP_NORMAL 1
  28. #define NP_SEEK 2
  29. #define NP_ASFILE 3
  30. #define NP_ASFILEONLY 4
  31. #define NPRES_DONE 0
  32. #define NPRES_NETWORK_ERR 1
  33. #define NPRES_USER_BREAK 2
  34. typedef unsigned short uint16;
  35. typedef unsigned long uint32;
  36. typedef short int16;
  37. typedef long int32;
  38. typedef unsigned char NPBool;
  39. typedef int16 NPError;
  40. typedef int16 NPReason;
  41. typedef char* NPMIMEType;
  42. typedef HRGN NPRegion;
  43. typedef void* JRIGlobalRef;
  44. struct JRIEnvInterface;
  45. typedef struct JRIEnvInterface JRIEnvInterface;
  46. typedef const JRIEnvInterface* JRIEnv;
  47. struct _jobject;
  48. typedef struct _jobject *jobject;
  49. typedef jobject jref;
  50. typedef struct _NPRect
  51. {
  52. uint16 top;
  53. uint16 left;
  54. uint16 bottom;
  55. uint16 right;
  56. } NPRect;
  57. typedef struct _NPP
  58. {
  59. void* pdata;
  60. void* ndata;
  61. } NPP_t;
  62. typedef NPP_t* NPP;
  63. typedef struct _NPStream
  64. {
  65. void* pdata;
  66. void* ndata;
  67. const char* url;
  68. uint32 end;
  69. uint32 lastmodified;
  70. void* notifyData;
  71. } NPStream;
  72. typedef enum {
  73. NPPVpluginNameString = 1,
  74. NPPVpluginDescriptionString,
  75. NPPVpluginWindowBool,
  76. NPPVpluginTransparentBool
  77. } NPPVariable;
  78. typedef enum {
  79. NPNVxDisplay = 1,
  80. NPNVxtAppContext,
  81. NPNVnetscapeWindow,
  82. NPNVjavascriptEnabledBool,
  83. NPNVasdEnabledBool,
  84. NPNVisOfflineBool
  85. } NPNVariable;
  86. typedef enum {
  87. NPWindowTypeWindow = 1,
  88. NPWindowTypeDrawable
  89. } NPWindowType;
  90. typedef struct _NPSavedData
  91. {
  92. int32 len;
  93. void* buf;
  94. } NPSavedData;
  95. typedef struct _NPByteRange
  96. {
  97. int32 offset;
  98. uint32 length;
  99. struct _NPByteRange* next;
  100. } NPByteRange;
  101. typedef struct _NPFullPrint
  102. {
  103. NPBool pluginPrinted;
  104. NPBool printOne;
  105. void* platformPrint;
  106. } NPFullPrint;
  107. typedef struct _NPWindow
  108. {
  109. void* window;
  110. int32 x;
  111. int32 y;
  112. uint32 width;
  113. uint32 height;
  114. NPRect clipRect;
  115. NPWindowType type;
  116. } NPWindow;
  117. typedef struct _NPEmbedPrint
  118. {
  119. NPWindow window;
  120. void* platformPrint;
  121. } NPEmbedPrint;
  122. typedef struct _NPPrint
  123. {
  124. uint16 mode;
  125. union
  126. {
  127. NPFullPrint fullPrint;
  128. NPEmbedPrint embedPrint;
  129. } print;
  130. } NPPrint;
  131. typedef struct _NPEvent
  132. {
  133. uint16 event;
  134. uint32 wParam;
  135. uint32 lParam;
  136. } NPEvent;
  137. typedef NPError (*NPP_NewUPP)(NPMIMEType,NPP,uint16,int16,char* argn[],char* argv[],NPSavedData*);
  138. typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save);
  139. typedef NPError (*NPP_SetWindowUPP)(NPP,NPWindow*);
  140. typedef NPError (*NPP_NewStreamUPP)(NPP,NPMIMEType,NPStream*,NPBool,uint16*);
  141. typedef NPError (*NPP_DestroyStreamUPP)(NPP,NPStream*,NPReason);
  142. typedef int32 (*NPP_WriteReadyUPP)(NPP instance,NPStream*);
  143. typedef int32 (*NPP_WriteUPP)(NPP,NPStream*,int32,int32,void*);
  144. typedef void (*NPP_StreamAsFileUPP)(NPP,NPStream*,const char*);
  145. typedef void (*NPP_PrintUPP)(NPP,NPPrint*);
  146. typedef int16 (*NPP_HandleEventUPP)(NPP,void*);
  147. typedef void (*NPP_URLNotifyUPP)(NPP,const char*,NPReason,void*);
  148. typedef NPError (*NPP_GetValueUPP)(NPP,NPPVariable,void*);
  149. typedef NPError (*NPP_SetValueUPP)(NPP,NPNVariable,void*);
  150. typedef NPError (*NPN_GetValueUPP)(NPP,NPNVariable,void*);
  151. typedef NPError (*NPN_SetValueUPP)(NPP,NPPVariable,void*);
  152. typedef NPError (*NPN_GetURLNotifyUPP)(NPP,const char*,const char*,void*);
  153. typedef NPError (*NPN_PostURLNotifyUPP)(NPP,const char*,const char*,uint32,const char*,NPBool,void*);
  154. typedef NPError (*NPN_GetURLUPP)(NPP,const char*,const char*);
  155. typedef NPError (*NPN_PostURLUPP)(NPP,const char*,const char*,uint32,const char*,NPBool);
  156. typedef NPError (*NPN_RequestReadUPP)(NPStream*,NPByteRange*);
  157. typedef NPError (*NPN_NewStreamUPP)(NPP,NPMIMEType,const char*,NPStream**);
  158. typedef int32 (*NPN_WriteUPP)(NPP,NPStream*,int32,void*);
  159. typedef NPError (*NPN_DestroyStreamUPP)(NPP,NPStream*,NPReason);
  160. typedef void (*NPN_StatusUPP)(NPP instance, const char*);
  161. typedef const char* (*NPN_UserAgentUPP)(NPP);
  162. typedef void* (*NPN_MemAllocUPP)(uint32);
  163. typedef void (*NPN_MemFreeUPP)(void*);
  164. typedef uint32 (*NPN_MemFlushUPP)(uint32);
  165. typedef void (*NPN_ReloadPluginsUPP)(NPBool);
  166. typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void);
  167. typedef jref (*NPN_GetJavaPeerUPP)(NPP);
  168. typedef void (*NPN_InvalidateRectUPP)(NPP,NPRect*);
  169. typedef void (*NPN_InvalidateRegionUPP)(NPP,NPRegion);
  170. typedef void (*NPN_ForceRedrawUPP)(NPP);
  171. typedef struct _NPPluginFuncs {
  172. uint16 size;
  173. uint16 version;
  174. NPP_NewUPP newp;
  175. NPP_DestroyUPP destroy;
  176. NPP_SetWindowUPP setwindow;
  177. NPP_NewStreamUPP newstream;
  178. NPP_DestroyStreamUPP destroystream;
  179. NPP_StreamAsFileUPP asfile;
  180. NPP_WriteReadyUPP writeready;
  181. NPP_WriteUPP write;
  182. NPP_PrintUPP print;
  183. NPP_HandleEventUPP event;
  184. NPP_URLNotifyUPP urlnotify;
  185. JRIGlobalRef javaClass;
  186. NPP_GetValueUPP getvalue;
  187. NPP_SetValueUPP setvalue;
  188. } NPPluginFuncs;
  189. typedef struct _NPNetscapeFuncs {
  190. uint16 size;
  191. uint16 version;
  192. NPN_GetURLUPP geturl;
  193. NPN_PostURLUPP posturl;
  194. NPN_RequestReadUPP requestread;
  195. NPN_NewStreamUPP newstream;
  196. NPN_WriteUPP write;
  197. NPN_DestroyStreamUPP destroystream;
  198. NPN_StatusUPP status;
  199. NPN_UserAgentUPP uagent;
  200. NPN_MemAllocUPP memalloc;
  201. NPN_MemFreeUPP memfree;
  202. NPN_MemFlushUPP memflush;
  203. NPN_ReloadPluginsUPP reloadplugins;
  204. NPN_GetJavaEnvUPP getJavaEnv;
  205. NPN_GetJavaPeerUPP getJavaPeer;
  206. NPN_GetURLNotifyUPP geturlnotify;
  207. NPN_PostURLNotifyUPP posturlnotify;
  208. NPN_GetValueUPP getvalue;
  209. NPN_SetValueUPP setvalue;
  210. NPN_InvalidateRectUPP invalidaterect;
  211. NPN_InvalidateRegionUPP invalidateregion;
  212. NPN_ForceRedrawUPP forceredraw;
  213. } NPNetscapeFuncs;
  214. #endif // NPAPIDEFS_H